bibliothek.gui.dock.control
Class ComponentHierarchyObserver

java.lang.Object
  extended by bibliothek.gui.dock.control.ComponentHierarchyObserver

public class ComponentHierarchyObserver
extends Object

A class collecting all Components which are somehow used on the Dockables in the realm of one DockController.
A global instance of ComponentHierarchyObserver can be obtained through DockController.getComponentHierarchyObserver().

Author:
Benjamin Sigg

Constructor Summary
ComponentHierarchyObserver(DockController controller)
          Creates a new observer.
 
Method Summary
 void addListener(ComponentHierarchyObserverListener listener)
          Adds a listener to this observer.
 Set<Component> getComponents()
          Gets a Set containing all Components which are used on Dockables known in the realm of the DockController of this observer.
 DockController getController()
          Gets the controller in whose realm this observer searches for Components.
protected  ComponentHierarchyObserverListener[] listeners()
          Gets an array containing all listeners that are registered at this observer.
 void removeListener(ComponentHierarchyObserverListener listener)
          Removes a listener from this observer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentHierarchyObserver

public ComponentHierarchyObserver(DockController controller)
Creates a new observer.

Parameters:
controller - the controller whose Dockables will be observed.
Method Detail

getComponents

public Set<Component> getComponents()
Gets a Set containing all Components which are used on Dockables known in the realm of the DockController of this observer.

Returns:
the set of Components.

getController

public DockController getController()
Gets the controller in whose realm this observer searches for Components.

Returns:
the controller

addListener

public void addListener(ComponentHierarchyObserverListener listener)
Adds a listener to this observer.

Parameters:
listener - the new listener, not null

removeListener

public void removeListener(ComponentHierarchyObserverListener listener)
Removes a listener from this observer.

Parameters:
listener - the listener to remove

listeners

protected ComponentHierarchyObserverListener[] listeners()
Gets an array containing all listeners that are registered at this observer.

Returns:
the list of listeners