|
Eclipse Rich Ajax Platform | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.rwt.lifecycle.JSWriter
IClientObject
to write changes
to the client.
@Deprecated public final class JSWriter
This class provides helper methods to generate Javascript used to update the client-side state of widgets.
Note that the Javascript code that is rendered relies on the client-side
org.eclipse.swt.WidgetManager
to be present.
AbstractWidgetLCA
,
ControlLCAUtil
,
WidgetLCAUtil
Field Summary | |
---|---|
static JSVar |
WIDGET_MANAGER_REF
Deprecated. A reference to the current widget manager on the client side. |
static JSVar |
WIDGET_REF
Deprecated. Reference to the widget of this JSWriter instance. |
Method Summary | |
---|---|
void |
addListener(java.lang.String eventType,
java.lang.String listener)
Deprecated. This will add a listener to the widget of this JSWriter . |
void |
addListener(java.lang.String property,
java.lang.String eventType,
java.lang.String listener)
Deprecated. This will add a listener to an object specified by the property of the widget. |
void |
call(JSVar target,
java.lang.String function,
java.lang.Object[] args)
Deprecated. Calls the specific function of the widget identified by
target on the client-side. |
void |
call(java.lang.String function,
java.lang.Object[] args)
Deprecated. Calls a specific function of the widget on the client-side. |
void |
call(Widget target,
java.lang.String function,
java.lang.Object[] args)
Deprecated. Calls the specific function of the widget identified by
target on the client-side. |
void |
callFieldAssignment(JSVar target,
java.lang.String field,
java.lang.String value)
Deprecated. |
void |
callStatic(java.lang.String function,
java.lang.Object[] args)
Deprecated. Calls the specified Javascript function with the given arguments. |
void |
dispose()
Deprecated. Dispose is used to dispose of the widget of this JSWriter on the
client side. |
void |
endCall(java.lang.Object[] args)
Deprecated. |
static JSWriter |
getWriterFor(Widget widget)
Deprecated. Returns an instance of JSWriter for the specified
widget . |
static JSWriter |
getWriterForResetHandler()
Deprecated. As of 1.3, server-side widget pooling is no longer required. This method should not be used anymore. |
void |
newWidget(java.lang.String className)
Deprecated. Creates a new widget on the client-side by creating an instance of the corresponding javascript class defined by className . |
void |
newWidget(java.lang.String className,
java.lang.Object[] args)
Deprecated. Creates a new widget on the client-side by creating an instance of the corresponding javascript class definition. |
void |
removeListener(java.lang.String eventType,
java.lang.String listener)
Deprecated. |
void |
removeListener(java.lang.String property,
java.lang.String eventType,
java.lang.String listener)
Deprecated. |
void |
reset(java.lang.String jsProperty)
Deprecated. Resets the specified javascript property to its initial value. |
void |
reset(java.lang.String[] jsPropertyChain)
Deprecated. Resets the specified javascript properties to their initial values. |
void |
set(java.lang.String[] jsPropertyChain,
java.lang.Object[] values)
Deprecated. Sets the specified properties of the client-side widget to new values. |
void |
set(java.lang.String jsProperty,
boolean value)
Deprecated. Sets the specified property of the client-side widget to a new value. |
void |
set(java.lang.String jsProperty,
boolean[] values)
Deprecated. Sets the specified property of the client-side widget to a new value. |
void |
set(java.lang.String jsProperty,
float value)
Deprecated. Sets the specified property of the client-side widget to a new value. |
void |
set(java.lang.String jsProperty,
float[] values)
Deprecated. Sets the specified property of the client-side widget to a new value. |
void |
set(java.lang.String jsProperty,
int value)
Deprecated. Sets the specified property of the client-side widget to a new value. |
void |
set(java.lang.String jsProperty,
int[] values)
Deprecated. Sets the specified property of the client-side widget to a new value. |
void |
set(java.lang.String jsProperty,
java.lang.Object value)
Deprecated. Sets the specified property of the client-side widget to a new value. |
void |
set(java.lang.String jsProperty,
java.lang.Object[] values)
Deprecated. Sets the specified property of the client-side widget to a new value. |
void |
set(java.lang.String jsProperty,
java.lang.String value)
Deprecated. Sets the specified property of the client-side widget to a new value. |
boolean |
set(java.lang.String javaProperty,
java.lang.String jsProperty,
java.lang.Object newValue)
Deprecated. Sets the specified jsProperty of the client-side widget to
the new value. |
boolean |
set(java.lang.String javaProperty,
java.lang.String jsProperty,
java.lang.Object newValue,
java.lang.Object defValue)
Deprecated. Sets the specified jsProperty of the client-side widget to
the new value. |
void |
setParent(java.lang.String parentId)
Deprecated. Explicitly sets the parent of the client-side widget. |
void |
startCall(JSVar target,
java.lang.String function,
java.lang.Object[] args)
Deprecated. |
void |
updateListener(JSListenerInfo info,
java.lang.String javaListener,
boolean hasListeners)
Deprecated. |
void |
updateListener(java.lang.String property,
JSListenerInfo info,
java.lang.String javaListener,
boolean hasListeners)
Deprecated. |
void |
varAssignment(JSVar var,
java.lang.String method)
Deprecated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static JSVar WIDGET_MANAGER_REF
IMPORTANT: This method is not part of the RWT public API. It is marked public only so that it can be shared within the packages provided by RWT. It should never be accessed from application code.
public static JSVar WIDGET_REF
IMPORTANT: This method is not part of the RWT public API. It is marked public only so that it can be shared within the packages provided by RWT. It should never be accessed from application code.
Method Detail |
---|
public static JSWriter getWriterFor(Widget widget)
JSWriter
for the specified
widget
. Only this writer can modify attributes and call
methods on the client-side representation of the widget.
widget
- the widget for the requested JSWriter
JSWriter
@Deprecated public static JSWriter getWriterForResetHandler()
JSWriter
instance used to reset a widgets attributes in
order to take part in the pooling mechanism.
JSWriter
instancepublic void newWidget(java.lang.String className) throws java.io.IOException
className
. This
is normally done in the renderInitialization
method of the
widgets life-cycle adapter (LCA).
className
- the javascript class to initiate
java.io.IOException
- if an I/O error occursAbstractWidgetLCA.renderInitialization(org.eclipse.swt.widgets.Widget)
public void newWidget(java.lang.String className, java.lang.Object[] args) throws java.io.IOException
renderInitialization
method of the widgets life-cycle
adapter (LCA). All arguments passed to this function will be transmitted
to the client and used to call the constructor of the javascript widget.
className
- the javascript class to initiateargs
- the arguments for the widgets constructor on the client-side
java.io.IOException
- if an I/O error occursAbstractWidgetLCA.renderInitialization(org.eclipse.swt.widgets.Widget)
public void setParent(java.lang.String parentId) throws java.io.IOException
parentId
- the widget id of the parent
java.io.IOException
- if an I/O error occursWidgetUtil
public void set(java.lang.String jsProperty, java.lang.String value) throws java.io.IOException
jsProperty
- the attribute to changevalue
- the new value
java.io.IOException
- if an I/O error occursAbstractWidgetLCA
public void set(java.lang.String jsProperty, int value) throws java.io.IOException
jsProperty
- the attribute to changevalue
- the new value
java.io.IOException
- if an I/O error occursAbstractWidgetLCA
public void set(java.lang.String jsProperty, float value) throws java.io.IOException
jsProperty
- the attribute to changevalue
- the new value
java.io.IOException
- if an I/O error occursAbstractWidgetLCA
public void set(java.lang.String jsProperty, boolean value) throws java.io.IOException
jsProperty
- the attribute to changevalue
- the new value
java.io.IOException
- if an I/O error occursAbstractWidgetLCA
public void set(java.lang.String jsProperty, int[] values) throws java.io.IOException
jsProperty
- the attribute to changevalues
- the new values
java.io.IOException
- if an I/O error occursAbstractWidgetLCA
public void set(java.lang.String jsProperty, float[] values) throws java.io.IOException
jsProperty
- the attribute to changevalues
- the new values
java.io.IOException
- if an I/O error occursAbstractWidgetLCA
public void set(java.lang.String jsProperty, boolean[] values) throws java.io.IOException
jsProperty
- the attribute to changevalues
- the new values
java.io.IOException
- if an I/O error occursAbstractWidgetLCA
public void set(java.lang.String jsProperty, java.lang.Object value) throws java.io.IOException
jsProperty
- the attribute to changevalue
- the new value
java.io.IOException
- if an I/O error occursAbstractWidgetLCA
public void set(java.lang.String jsProperty, java.lang.Object[] values) throws java.io.IOException
jsProperty
- the attribute to changevalues
- the new values
java.io.IOException
- if an I/O error occursAbstractWidgetLCA
public void set(java.lang.String[] jsPropertyChain, java.lang.Object[] values) throws java.io.IOException
jsPropertyChain
- the attributes to changevalues
- the new values
java.io.IOException
- if an I/O error occursAbstractWidgetLCA
public boolean set(java.lang.String javaProperty, java.lang.String jsProperty, java.lang.Object newValue) throws java.io.IOException
jsProperty
of the client-side widget to
the new value. Uses the specified javaProperty
as a key
to obtain the preserved value and only sets the new value if it has
changed since it was preserved.
javaProperty
- the key used to obtain the preserved valuejsProperty
- the client-side attribute to changenewValue
- the new values
true
if the new value differs from the preserved
value (meaning that JavaScript was written); false
otherwise
java.io.IOException
- if an I/O error occursAbstractWidgetLCA.preserveValues(Widget)
public boolean set(java.lang.String javaProperty, java.lang.String jsProperty, java.lang.Object newValue, java.lang.Object defValue) throws java.io.IOException
jsProperty
of the client-side widget to
the new value. Uses the specified javaProperty
as a key
to obtain the preserved value and only sets the new value if it has
changed since it was preserved.
If the widget is rendered for the first time, there is no preserved
value present. In this case the defValue
is taken into
account instead of the preserved value of the javaProperty
.
Therefore, the default value must match the initial value of the attribute
of the client-side widget. If there is no constant initial client-side
value, resort the set(String,String,Object)
.
javaProperty
- the key used to obtain the preserved valuejsProperty
- the client-side attribute to changenewValue
- the new valuesdefValue
- the default value
true
if the new value differs from the preserved
value (meaning that JavaScript was written); false
otherwise
java.io.IOException
- if an I/O error occursAbstractWidgetLCA.preserveValues(Widget)
public void reset(java.lang.String jsProperty) throws java.io.IOException
jsProperty
- the javascript property to reset
java.io.IOException
- if an I/O error occurspublic void reset(java.lang.String[] jsPropertyChain) throws java.io.IOException
jsPropertyChain
- the javascript properties to reset
java.io.IOException
- if an I/O error occurspublic void addListener(java.lang.String property, java.lang.String eventType, java.lang.String listener) throws java.io.IOException
qx.event.type.Event
object.
property
- the property of the widget to what the listener should be addedeventType
- the type of the eventlistener
- reference to the listener function
java.io.IOException
- if an I/O error occurspublic void addListener(java.lang.String eventType, java.lang.String listener) throws java.io.IOException
JSWriter
. The
listener has to be a javascript function which accepts exact one
parameter - an qx.event.type.Event
object.
eventType
- the type of the eventlistener
- reference to the listener function
java.io.IOException
- if an I/O error occurspublic void updateListener(java.lang.String property, JSListenerInfo info, java.lang.String javaListener, boolean hasListeners) throws java.io.IOException
java.io.IOException
public void updateListener(JSListenerInfo info, java.lang.String javaListener, boolean hasListeners) throws java.io.IOException
java.io.IOException
public void removeListener(java.lang.String eventType, java.lang.String listener)
public void removeListener(java.lang.String property, java.lang.String eventType, java.lang.String listener)
public void call(java.lang.String function, java.lang.Object[] args) throws java.io.IOException
function
- the function nameargs
- the arguments for the function
java.io.IOException
- if an I/O error occurspublic void call(Widget target, java.lang.String function, java.lang.Object[] args) throws java.io.IOException
function
of the widget identified by
target
on the client-side.
target
- the widget on which the function should be calledfunction
- the function to be calledargs
- the arguments for the function
java.io.IOException
- if an I/O error occurspublic void call(JSVar target, java.lang.String function, java.lang.Object[] args) throws java.io.IOException
function
of the widget identified by
target
on the client-side.
target
- the widget on which the function should be calledfunction
- the function nameargs
- the arguments for the function
java.io.IOException
- if an I/O error occurspublic void startCall(JSVar target, java.lang.String function, java.lang.Object[] args)
public void endCall(java.lang.Object[] args)
public void callStatic(java.lang.String function, java.lang.Object[] args) throws java.io.IOException
function
- the function nameargs
- the arguments for the function
java.io.IOException
- if an I/O error occurspublic void callFieldAssignment(JSVar target, java.lang.String field, java.lang.String value)
public void varAssignment(JSVar var, java.lang.String method)
public void dispose() throws java.io.IOException
JSWriter
on the
client side.
java.io.IOException
- if an I/O error occurs
|
Eclipse Rich Ajax Platform | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) EclipseSource and others 2002, 2012. All rights reserved.