public class ComponentManager extends Object implements RegisterEvent.HasRegisterHandlers<Component>, UnregisterEvent.HasUnregisterHandlers<Component>
Component. Components
automatically register and unregister with the widget manager when they
are attached and detached.
Attaching and detaching are parts of the GWT widget lifecycle. Basically,
widgets are attached when they become part of the DOM and then detached when
removed from the DOM.
RegisterEventUnregisterEvent| Modifier and Type | Method and Description |
|---|---|
HandlerRegistration |
addRegisterHandler(RegisterEvent.RegisterHandler<Component> handler)
Adds a
RegisterEvent handler. |
HandlerRegistration |
addUnregisterHandler(UnregisterEvent.UnregisterHandler<Component> handler)
Adds a
UnregisterEvent handler. |
<X extends Component> |
find(Element target)
Attempts to find a widget.
|
<X extends Component> |
find(Element target,
Class<X> clazz)
Attempts to find a widget.
|
static ComponentManager |
get()
Returns the widget manager instance.
|
<X extends Component> |
get(Class<?> clazz)
Returns all widget by class.
|
Component |
get(String id)
Returns a widget by id.
|
Collection<Component> |
getAll()
Returns a collection of all registered components.
|
public static ComponentManager get()
public HandlerRegistration addRegisterHandler(RegisterEvent.RegisterHandler<Component> handler)
RegisterEvent.HasRegisterHandlersRegisterEvent handler.addRegisterHandler in interface RegisterEvent.HasRegisterHandlers<Component>handler - the handlerpublic HandlerRegistration addUnregisterHandler(UnregisterEvent.UnregisterHandler<Component> handler)
UnregisterEvent.HasUnregisterHandlersUnregisterEvent handler.addUnregisterHandler in interface UnregisterEvent.HasUnregisterHandlers<Component>handler - the handlerpublic <X extends Component> X find(Element target)
target - the element or inner element of the widgetpublic <X extends Component> X find(Element target, Class<X> clazz)
target - the element or inner element of the widgetclazz - the class the widget should havepublic <X extends Component> List<X> get(Class<?> clazz)
clazz - the class to matchpublic Component get(String id)
id - the widget idpublic Collection<Component> getAll()
Copyright © 2012. All Rights Reserved.