com.extjs.gxt.ui.client.widget
Class ComponentManager

java.lang.Object
  extended by com.extjs.gxt.ui.client.event.BaseObservable
      extended by com.extjs.gxt.ui.client.widget.ComponentManager
All Implemented Interfaces:
Observable

public class ComponentManager
extends BaseObservable

Provides a registry of all attached components. Only components currently part of the page (DOM) are part of the registry as all components register when attached, and unregister when detached.

    Collection components = ComponentManager.get().getAll();
    Component comp = ComponentManager.get().get("foo");
    for (Component c : components) {

    }
 
Events:
Register : ComponentManagerEvent(source, component)
Fires after the component is registered.
Unregister : ComponentManagerEvent(source, component)
Fires after the component is unregistered.


Method Summary
static ComponentManager get()
          Returns the component manager instance.
<X extends Component>
java.util.List<X>
get(java.lang.Class<?> clazz)
          Returns all component by class.
 Component get(java.lang.String id)
          Returns a component by id.
 java.util.Collection<Component> getAll()
          Returns a collection of all registered components.
 void register(Component component)
           
 void unregister(Component component)
           
 
Methods inherited from class com.extjs.gxt.ui.client.event.BaseObservable
addListener, fireEvent, fireEvent, getFiresEvents, getListeners, hasActiveEvent, hasListeners, hasListeners, removeAllListeners, removeListener, setFiresEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public static ComponentManager get()
Returns the component manager instance.

Returns:
the component manager

get

public <X extends Component> java.util.List<X> get(java.lang.Class<?> clazz)
Returns all component by class.

Parameters:
clazz - the class to match
Returns:
the list of matching components

get

public Component get(java.lang.String id)
Returns a component by id.

Parameters:
id - the component id
Returns:
the component or null if no match

getAll

public java.util.Collection<Component> getAll()
Returns a collection of all registered components.

Returns:
the collection of components

register

public void register(Component component)

unregister

public void unregister(Component component)