public class ComponentHierarchyObserver extends Object
Component
s which are somehow used on or with
the Dockable
s in the realm of one DockController
.ComponentHierarchyObserver
can be obtained
through DockController.getComponentHierarchyObserver()
.Component
s which are
not directly associated with Dockable
s.Constructor and Description |
---|
ComponentHierarchyObserver(DockController controller)
Creates a new observer.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Component component)
Adds
component and all its children to the set of
known Component s. |
void |
addListener(ComponentHierarchyObserverListener listener)
Adds a listener to this observer.
|
Set<Component> |
getComponents()
Gets a
Set containing all Component s which are
used on Dockable s known in the realm of the DockController
of this observer. |
DockController |
getController()
Gets the controller in whose realm this observer searches for
Component s. |
protected ComponentHierarchyObserverListener[] |
listeners()
Gets an array containing all listeners that are registered at this
observer.
|
void |
remove(Component component)
Removes
component and all its children from the set
of known Component s. |
void |
removeListener(ComponentHierarchyObserverListener listener)
Removes a listener from this observer.
|
public ComponentHierarchyObserver(DockController controller)
controller
- the controller whose Dockable
s will be observed.public Set<Component> getComponents()
Set
containing all Component
s which are
used on Dockable
s known in the realm of the DockController
of this observer.Component
s.public DockController getController()
Component
s.public void addListener(ComponentHierarchyObserverListener listener)
listener
- the new listener, not null
public void removeListener(ComponentHierarchyObserverListener listener)
listener
- the listener to removeprotected ComponentHierarchyObserverListener[] listeners()
public void add(Component component)
component
and all its children to the set of
known Component
s. Components that are already known will
not be registered twice. This observer will notice when a child of
component
changes and update itself accordingly.component
- the new component