public final class JsHelper extends Object
Modifier and Type | Method and Description |
---|---|
List<String> |
elementAttributes(Element element)
Returns a list of strings with element attributes.
|
static JsHelper |
get()
Singleton object to get the helper instance
|
boolean |
isCanvasGradient(NativeObjectContainer object,
String key)
Returns
true if the property into native object is a CanvasGradient . |
boolean |
isCanvasPattern(NativeObjectContainer object,
String key)
Returns
true if the property into native object is a CanvasPattern . |
ChartNativeEvent |
nativeEvent(NativeObject event,
String key)
Returns a chart native event from CHART.JS event.
|
<T> CallbackProxy<T> |
newCallbackProxy()
Creates new proxy for callback which will pass
this environment of java script as first argument of callback
method. |
double |
propertyAsDouble(Object object,
String key)
Returns a property of java script object as double.
|
int |
propertyAsInt(Object object,
String key)
Returns a property of java script object as integer.
|
String |
propertyAsString(Object object,
String key)
Returns a property of java script object as string.
|
void |
setLineDash(Context2d context,
ArrayInteger object)
Sets the line dash pattern used when stroking lines.
It uses an array of values that specify alternating lengths of lines and gaps which describe the pattern. |
void |
setLineDash(Context2d context,
List<Integer> items)
Sets the line dash pattern used when stroking lines.
It uses a list of values that specify alternating lengths of lines and gaps which describe the pattern. |
ObjectType |
typeOf(Object object)
Returns the java script object type of object.
|
ObjectType |
typeOf(Object object,
String key)
Returns the java script object type of a property.
|
Object |
undefined()
Returns an undefined reference
|
public static JsHelper get()
public Object undefined()
public List<String> elementAttributes(Element element)
element
- DOM element to scanpublic ObjectType typeOf(Object object)
object
- the object to get type.public ObjectType typeOf(Object object, String key)
object
- the object on which to search the property.key
- the string name of the property to test.public <T> CallbackProxy<T> newCallbackProxy()
this
environment of java script as first argument of callback
method.T
- type of callback wrapped by proxypublic int propertyAsInt(Object object, String key)
object
- the object on which to define the property.key
- the string name of the property to be defined or modified..UndefinedValues.INTEGER
if arguments are not consistentpublic double propertyAsDouble(Object object, String key)
object
- the object on which to define the property.key
- the string name of the property to be defined or modified..UndefinedValues.DOUBLE
if arguments are not consistentpublic String propertyAsString(Object object, String key)
object
- the object on which to define the property.key
- the string name of the property to be defined or modified..UndefinedValues.STRING
if arguments are not consistentpublic boolean isCanvasPattern(NativeObjectContainer object, String key)
true
if the property into native object is a CanvasPattern
.object
- the object on which to define the property.key
- the string name of the property to be defined or modified..true
if the property into native object is a CanvasPattern
public boolean isCanvasGradient(NativeObjectContainer object, String key)
true
if the property into native object is a CanvasGradient
.object
- the object on which to define the property.key
- the string name of the property to be defined or modified..true
if the property into native object is a CanvasGradient
public void setLineDash(Context2d context, List<Integer> items)
context
- context of canvasitems
- list of values that specify alternating lengths of lines and gaps which describe the patternpublic void setLineDash(Context2d context, ArrayInteger object)
context
- context of canvasobject
- array of values that specify alternating lengths of lines and gaps which describe the patternpublic ChartNativeEvent nativeEvent(NativeObject event, String key)
event
- CHART.JS eventkey
- key of java script object