|
![](/images/navbasebg.jpg) |
|
|
org.eclipse.rwt.lifecycle
Class WidgetUtil
java.lang.Object
org.eclipse.rwt.lifecycle.WidgetUtil
- public final class WidgetUtil
- extends
Object
This is a helper class to obtain different aspects for a widget
related to the handling of widgets in RAP.
-
Since:
- 1.0
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. |
Methods inherited from class java.lang.
Object
|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
|
CUSTOM_VARIANT
public static final
String CUSTOM_VARIANT
- Used to mark a widget as belonging to a custom variant using
Widget.setData . For more information on custom widget
variants, see the RAP help on theming.
-
Since:
- 1.1
-
See Also:
-
Widget.setData(String,Object) ,
Constant Field Values
CUSTOM_WIDGET_ID
public static final
String CUSTOM_WIDGET_ID
-
Note: This constant is provisional and subject to
change without further notice.
By default, the widget-id returned by
IWidgetAdapter.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" );
-
Since:
- 1.1
-
See Also:
-
Widget.setData(String,Object) ,
getId(Widget) ,
Constant Field Values
ENABLE_UI_TESTS
public 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 to true , 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.
-
Since:
- 1.1
-
See Also:
-
CUSTOM_WIDGET_ID ,
Constant Field Values
getAdapter
public static
IWidgetAdapter getAdapter(
Widget widget)
- Returns the according
IWidgetAdapter for a specified
widget.
-
-
Parameters:
-
widget - the widget
-
Returns:
- the
IWidgetAdapter instance
getId
public static
String getId(
Widget widget)
- Returns the id of the given
widget that is used to identify
the widget on the client.
-
-
Parameters:
-
widget - the widget to obtain the id for, must not be
null
-
Returns:
- the id for the given
widget
getVariant
public static
String getVariant(
Widget widget)
- Returns the widget variant defined for the given widget using
Widget.setData() .
-
-
Parameters:
-
widget - the widget whose variant is requested
-
Returns:
- the variant or
null if no variant has been specified
for the given widget
getLCA
public static
AbstractWidgetLCA getLCA(
Widget widget)
- Returns the
AbstractWidgetLCA instance for this widget.
-
-
Parameters:
-
widget - the widget to obtain the life cycle adapter from
-
Returns:
- the life cycle adapter for the given
widget
find
public static
Widget find(
Composite root,
String id)
- This method searches for a widget with the given
id within
the widget hierachy starting at root .
-
-
Parameters:
-
root - the root widget where to start the search -
id - the id of the widget to search for
-
Returns:
- the widget or
null if there was no widget found with
the given id within the widget hierarchy
Copyright (c) Innoopract Informationssysteme GmbH and others 2002, 2008. All rights reserved.
|
|
|