|
Eclipse Rich Ajax Platform Release 1.3 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.rwt.lifecycle.AbstractWidgetLCA
Abstract implementation of a widget life cycle adapter. All widget LCAs should inherit from this class.
Constructor Summary | |
AbstractWidgetLCA()
|
Method Summary | |
Rectangle |
adjustCoordinates(Widget widget,
Rectangle bounds)
Translates the bounds of a widget that is enclosed in the widget handled by this LCA. |
void |
createResetHandlerCalls(String typePoolId)
Deprecated. As of 1.3, server-side widget pooling is no longer required. This method is not called anymore. |
void |
doRedrawFake(Control control)
As a side effect to redraw calls some native widgets trigger events like resize for example. |
String |
getTypePoolId(Widget widget)
Deprecated. As of 1.3, server-side widget pooling is no longer required. This method is not called anymore. |
abstract void |
preserveValues(Widget widget)
Preserves the current state of the widget in order to be able to keep track of changes. |
void |
render(Widget widget)
Writes JavaScript code to the response that renders the changes that has been made to the widget. |
abstract void |
renderChanges(Widget widget)
Writes JavaScript code to the response that applies the state changes of the widget to the client. |
abstract void |
renderDispose(Widget widget)
Writes JavaScript code to the response that renders the disposal of the widget. |
abstract void |
renderInitialization(Widget widget)
Writes JavaScript code to the response that creates a new widget instance and initializes it. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.rwt.lifecycle.IWidgetLifeCycleAdapter |
readData |
Constructor Detail |
public AbstractWidgetLCA()
Method Detail |
public final void render(Widget widget) throws IOException
IWidgetLifeCycleAdapter
render
in interface IWidgetLifeCycleAdapter
widget
- the widget to render changes for
IOException
public Rectangle adjustCoordinates(Widget widget, Rectangle bounds)
widget
- the enclosed widget whose bounds to adjustbounds
- the actual bounds of the enclosed widget
public abstract void preserveValues(Widget widget)
IWidgetLifeCycleAdapter
Implementors can use the method
IWidgetAdapter.preserve(String, Object)
. As a rule of thumb, every
property that is written in render
must be preserved in this
method.
preserveValues
in interface IWidgetLifeCycleAdapter
widget
- the widget, the properties of which are preservedpublic abstract void renderInitialization(Widget widget) throws IOException
renderChanges
is called for the first time.
widget
- the widget to initialize
IOException
public abstract void renderChanges(Widget widget) throws IOException
widget
- the widget to render changes for
IOException
public abstract void renderDispose(Widget widget) throws IOException
widget
- the widget to dispose
IOException
public void createResetHandlerCalls(String typePoolId) throws IOException
Writes JavaScript code to the response that resets the client-side state of a disposed widget in order to make it ready for later reuse. After this code has been processed the client-side widget should be in a state that is equivalent to a newly created widget.
Subclasses should override this method if pooling is supported by the
widget type this LCA belongs to. To activate pooling override
getTypePoolId(Widget)
.
typePoolId
- the type pool id of the widget to reset
IOException
getTypePoolId(Widget)
public String getTypePoolId(Widget widget)
The widget pool is used to store disposed widget instances on the client for later reuse. This is necessary to improve performance and to save client memory. Only widgets with the same type pool id can be reused.
Usually, the fully qualified class name is a suitable return value. In case
different sub-types of widget instances should be distinguished, this
method must return a different string for every type, e.g. by appending a
suffix. If this method returns null
, the widget will not be
stored in the widget pool and cannot be reused.
Subclasses may override to activate pooling. In case pooling is activated
the method createResetHandlerCalls(String)
should also be
overridden.
widget
- the widget to store in the pool
null
if the widget should not be
pooledcreateResetHandlerCalls(String)
public void doRedrawFake(Control control)
As a side effect to redraw calls some native widgets trigger events like
resize for example. To simulate this behaviour subclasses may override
this method. The method takes as parameter type Control
,
since the redraw methods are only available at the Control
subclasses of Widgets
.
Note that the redraw fake takes place between the process action and the render phase.
control
- the control on which redraw was called.
|
Eclipse Rich Ajax Platform Release 1.3 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) Innoopract Informationssysteme GmbH and others 2002, 2011. All rights reserved.