Class WJavaScriptExposableObject
- Direct Known Subclasses:
WBrush
,WPainterPath
,WPen
,WPointF
,WRectF
,WTransform
public abstract class WJavaScriptExposableObject
extends java.lang.Object
A JavaScript bound object (as opposed to being mostly a simple value class) has an equivalent
representation in JavaScript. Its value can usually only be modified through a WJavaScriptHandle
. There are certain exceptions to this rule. Some methods, notably many WTransform
methods, will correctly apply these modifications also on the JavaScript
representation.
- See Also:
WJavaScriptHandle
-
Constructor Summary
Constructors Constructor Description WJavaScriptExposableObject()
WJavaScriptExposableObject(WJavaScriptExposableObject other)
-
Method Summary
Modifier and Type Method Description protected void
assignBinding(WJavaScriptExposableObject rhs)
protected void
assignBinding(WJavaScriptExposableObject rhs, java.lang.String jsRef)
protected abstract void
assignFromJSON(com.google.gson.JsonElement value)
protected void
checkModifiable()
abstract WJavaScriptExposableObject
clone()
boolean
closeTo(WJavaScriptExposableObject other)
java.lang.String
getJsRef()
Returns a JavaScript reference to this object.abstract java.lang.String
getJsValue()
Returns a JavaScript representation of the value of this object.boolean
isJavaScriptBound()
Returns whether this object is JavaScript bound.protected boolean
sameBindingAs(WJavaScriptExposableObject rhs)
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
WJavaScriptExposableObject
public WJavaScriptExposableObject() -
WJavaScriptExposableObject
-
-
Method Details
-
clone
- Overrides:
clone
in classjava.lang.Object
-
isJavaScriptBound
public boolean isJavaScriptBound()Returns whether this object is JavaScript bound.An object is JavaScript bound if it is associated with a
WJavaScriptHandle
. It should not be modified directly on the server side.WJavaScriptHandle.setValue(T)
should be used instead. -
getJsValue
public abstract java.lang.String getJsValue()Returns a JavaScript representation of the value of this object.Note: The value returned will reflect the current server side value of the object. If this object is JavaScript bound, this value may not reflect the actual client side value. If you need access to the client side value, use
getJsRef()
intead. -
getJsRef
public java.lang.String getJsRef()Returns a JavaScript reference to this object.If this object is not JavaScript bound, it will return a JavaScript representation of the value of the object, according to
getJsValue()
.Warning: This reference is intended as read-only. Attempts to modify it may have unintended consequences. If you want a JavaScript reference that is modifiable, use the
WJavaScriptHandle.getJsRef()
instead. -
closeTo
-
sameBindingAs
-
assignBinding
-
assignBinding
-
checkModifiable
protected void checkModifiable() -
assignFromJSON
protected abstract void assignFromJSON(com.google.gson.JsonElement value)
-