bibliothek.gui.dock.component
Class DockComponentRootHandler

java.lang.Object
  extended by bibliothek.gui.dock.component.DockComponentRootHandler
Direct Known Subclasses:
DefaultDockStationComponentRootHandler

public abstract class DockComponentRootHandler
extends Object

A wrapper for a DockComponentRoot, implements all the features required to fully support DockComponentConfiguration.

Author:
Benjamin Sigg

Nested Class Summary
protected static class DockComponentRootHandler.TraverseResult
          Behavior for traversing the Component tree
 
Constructor Summary
DockComponentRootHandler(DockComponentRoot root)
          Creates a new handler
 
Method Summary
 void addRoot(Component component)
          Adds component as root Component, it will be forwarded to the DockComponentConfiguration.
 DockComponentConfiguration getConfiguration()
          Gets the configuration that is applied to root.
 void removeRoot(Component component)
          Removes component as root.
 void setConfiguration(DockComponentConfiguration configuration)
          Sets the configuration that is to be applied to root.
 void setController(DockController controller)
          Sets the controller in whose realm this handler is used.
protected abstract  DockComponentRootHandler.TraverseResult shouldTraverse(Component component)
          Tells whether component should be visited and configured.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DockComponentRootHandler

public DockComponentRootHandler(DockComponentRoot root)
Creates a new handler

Parameters:
root - the root represented by this, not null
Method Detail

setConfiguration

public void setConfiguration(DockComponentConfiguration configuration)
Sets the configuration that is to be applied to root. Note that this method does not call DockComponentRoot.setComponentConfiguration(DockComponentConfiguration), instead it is expected to be called by said method.

Parameters:
configuration - the new configuration, can be null

getConfiguration

public DockComponentConfiguration getConfiguration()
Gets the configuration that is applied to root. Note that this method does not call DockComponentRoot.getComponentConfiguration(), instead it is expected to be called by said method.

Returns:
the current configuration, can be null

setController

public void setController(DockController controller)
Sets the controller in whose realm this handler is used.

Parameters:
controller - the controller, can be null

addRoot

public void addRoot(Component component)
Adds component as root Component, it will be forwarded to the DockComponentConfiguration.

Parameters:
component - a new root component

removeRoot

public void removeRoot(Component component)
Removes component as root.

Parameters:
component - the component to remove

shouldTraverse

protected abstract DockComponentRootHandler.TraverseResult shouldTraverse(Component component)
Tells whether component should be visited and configured.

Parameters:
component - the component to check
Returns:
the exact behavior for component