|
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.Objectorg.eclipse.rwt.lifecycle.WidgetUtil
This is a helper class to obtain different aspects for a widget related to the handling of widgets in RAP.
Field Summary | |
static String |
CUSTOM_VARIANT
Used to mark a widget as belonging to a custom variant using Widget.setData . |
static String |
CUSTOM_WIDGET_ID
Note: This constant is provisional and subject to change without further notice. |
static String |
ENABLE_UI_TESTS
Note: This constant is provisional and subject to change without further notice. |
Method Summary | |
static Widget |
find(Composite root,
String id)
This method searches for a widget with the given id within
the widget hierachy starting at root . |
static IWidgetAdapter |
getAdapter(Widget widget)
Returns the according IWidgetAdapter for a specified
widget. |
static String |
getId(Widget widget)
Returns the id of the given widget that is used to identify
the widget on the client. |
static AbstractWidgetLCA |
getLCA(Widget widget)
Returns the AbstractWidgetLCA instance for this widget. |
static String |
getVariant(Widget widget)
Returns the widget variant defined for the given widget using Widget.setData() . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String CUSTOM_VARIANT
Widget.setData
. For more information on custom widget
variants, see the RAP help on theming.
Widget.setData(String,Object)
,
Constant Field Valuespublic static final String CUSTOM_WIDGET_ID
Note: This constant is provisional and subject to change without further notice.
By default, the widget-id returned byIWidgetAdapter.getId()
is
an automatically generated value that is session-wide unique.
A custom id can be assigned by using the Widget#setData(String,
Object)
method and using this constant for the key
argument and a string that denotes the new id as the data
argument.
The id
must only contain characters that are valid according
to the W3C
recommendation for id and name attributes.
It is the clients' responsibility to choose a unique id. Assigning an id that is used by another widget will lead to indeterministic behavior.
The following code would assign the id 'myId' to the widget:
Widget widget = new ... widget.setData( WidgetUtil.CUSTOM_WIDGET_ID, "myId" );
Widget.setData(String,Object)
,
getId(Widget)
,
Constant Field Valuespublic static final String ENABLE_UI_TESTS
Note: This constant is provisional and subject to change without further notice.
If a system property with this name is set totrue
, the
UI testing support is activated. For all widgets that are rendered to
the client, the HTML id attribute is set.
In conjunction with CUSTOM_WIDGET_ID
, each widget can
be assigned a custom, more human-readable, identifier that is independant
if the order in which widgets are created.
CUSTOM_WIDGET_ID
,
Constant Field ValuesMethod Detail |
public static IWidgetAdapter getAdapter(Widget widget)
IWidgetAdapter
for a specified
widget.
widget
- the widget
IWidgetAdapter
instancepublic static String getId(Widget widget)
widget
that is used to identify
the widget on the client.
widget
- the widget to obtain the id for, must not be
null
widget
public static String getVariant(Widget widget)
Widget.setData()
.
widget
- the widget whose variant is requested
null
if no variant has been specified
for the given widgetpublic static AbstractWidgetLCA getLCA(Widget widget)
AbstractWidgetLCA
instance for this widget.
widget
- the widget to obtain the life cycle adapter from
widget
public static Widget find(Composite root, String id)
id
within
the widget hierachy starting at root
.
root
- the root widget where to start the searchid
- the id of the widget to search for
null
if there was no widget found with
the given id
within the widget hierarchy
|
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, 2009. All rights reserved.