public final class JsHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static JsHelper |
get()
Singleton object to get the helper instance
|
boolean |
isCanvasGradient(Object object)
Returns
true if the object is a CanvasGradientItem. |
boolean |
isCanvasPattern(Object object)
Returns
true if the object is a CanvasPatternItem. |
<T> CallbackProxy<T> |
newCallbackProxy()
Creates new proxy for callback which will pass
this environment of java script as first argument of callback method. |
int |
propertyAsInt(NativeObject object,
String key)
Returns a property of java script object as integer.
|
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.
|
public static JsHelper get()
public 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 boolean isCanvasPattern(Object object)
true if the object is a CanvasPatternItem.object - the object instance on which to checktrue if the object is a CanvasPatternItempublic boolean isCanvasGradient(Object object)
true if the object is a CanvasGradientItem.object - the object instance on which to checktrue if the object is a CanvasGradientItempublic int propertyAsInt(NativeObject 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 consistent