|
Eclipse Remote Application Platform | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.rap.rwt.lifecycle.WidgetUtil
public final class WidgetUtil
This is a helper class to obtain different aspects for a widget related to the handling of widgets in RAP.
| Field Summary | |
|---|---|
static java.lang.String |
CUSTOM_VARIANT
Deprecated. Use RWT.CUSTOM_VARIANT instead |
static java.lang.String |
CUSTOM_WIDGET_ID
Note: This constant is provisional and subject to change without further notice. |
static java.lang.String |
ENABLE_UI_TESTS
Deprecated. The system property has been moved to the internal class RWTProperties. Please look up the name in the
documentation of CUSTOM_WIDGET_ID. |
| Method Summary | |
|---|---|
static Widget |
find(Composite root,
java.lang.String id)
This method searches for a widget with the given id within
the widget hierachy starting at root. |
static WidgetAdapter |
getAdapter(Widget widget)
Returns the according WidgetAdapter for a specified
widget. |
static java.lang.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 java.lang.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 |
|---|
@Deprecated public static final java.lang.String CUSTOM_VARIANT
RWT.CUSTOM_VARIANT insteadpublic static final java.lang.String CUSTOM_WIDGET_ID
Note: This constant is provisional and subject to change without further notice.
This constant can be used to apply a custom widget id to a widget. By default, the framework applies a unique widget id to every widget. This id is used to identify the widget in the client/server protocol. For UI tests, it can be helpful to replace these generated ids with custom ids in order to make the ids more human-readable and more stable against changes in the UI. The following snippet applies a custom widget id to a widget:
widget.setData( WidgetUtil.CUSTOM_WIDGET_ID, "myCustomId" )
The support for custom widget ids must be explicitly enabled by setting the
system property org.eclipse.rap.rwt.enableUITests to
true. If activated, the default web client will also set the
HTML id attribute for every widget that are rendered to the client to the
widget id.
A custom widget id must be unique within the user session. It is the clients' responsibility to choose a unique id. Assigning an id that is used by another widget will lead to indeterministic behavior.
A custom widget id must only contain characters that are valid according to the W3C recommendation for id and name attributes.
Widget.setData(String,Object),
getId(Widget),
Constant Field Values@Deprecated public static final java.lang.String ENABLE_UI_TESTS
RWTProperties. Please look up the name in the
documentation of CUSTOM_WIDGET_ID.CUSTOM_WIDGET_ID| Method Detail |
|---|
public static WidgetAdapter getAdapter(Widget widget)
WidgetAdapter for a specified
widget.
widget - the widget
WidgetAdapter instancepublic static java.lang.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
widgetpublic static java.lang.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
public static Widget find(Composite root,
java.lang.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 Remote Application Platform | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright (c) EclipseSource and others 2002, 2013. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0