public class ComponentHelper extends Object
Constructor and Description |
---|
ComponentHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
doAttach(Widget widget)
Attach a widget
|
static void |
doDetach(Widget widget)
Detaches a widget
|
static HandlerManager |
ensureHandlers(Widget widget)
Returns the handler manager for the specified widget, creating it if
necessary.
|
static String |
getWidgetId(Widget widget)
Retrieves the ID that has been set on a widget's element.
|
static Widget |
getWidgetWithElement(Element element)
Find a the nearest widget that contains the given element.
|
static boolean |
hasElement(Widget widget)
Determines if the widget has an Element
|
static <H extends EventHandler> |
removeHandler(Widget widget,
GwtEvent.Type<H> type,
H handler)
Removes a handler from the widget
|
static void |
setParent(Widget parent,
Widget child)
Sets the child to the parent widget
|
public static Widget getWidgetWithElement(Element element)
element
- the element to start atpublic static void doAttach(Widget widget)
widget
- the widget to attachpublic static void doDetach(Widget widget)
widget
- the widget to detachpublic static HandlerManager ensureHandlers(Widget widget)
widget
- the widgetpublic static String getWidgetId(Widget widget)
widget
- The widget whose element's ID is to be retrieved. Must not be
null
.public static boolean hasElement(Widget widget)
widget
- the target Elementpublic static <H extends EventHandler> void removeHandler(Widget widget, GwtEvent.Type<H> type, H handler)
widget
- the target widgettype
- the typehandler
- the handler to removeCopyright © 2015. All rights reserved.