bibliothek.gui.dock.disable
Class TabDisablingStrategyObserver

java.lang.Object
  extended by bibliothek.gui.dock.disable.TabDisablingStrategyObserver

public abstract class TabDisablingStrategyObserver
extends Object

This class offers a convenient way to observe a set of Dockable and find out whether their tab should be disabled according to the current DisablingStrategy.

Author:
Benjamin Sigg

Constructor Summary
TabDisablingStrategyObserver()
           
 
Method Summary
 void add(Dockable dockable)
          Adds dockable to the set of dockables that must be observed
 boolean isDisabled(Dockable dockable)
          Tells whether the tab of dockable is disabled.
 void remove(Dockable dockable)
          Removes dockable from the set of dockables that must be observed
 void setController(DockController controller)
          Sets the controller in whose realm this observer is used.
abstract  void setDisabled(Dockable dockable, boolean disabled)
          Called if dockable was enabled or disabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TabDisablingStrategyObserver

public TabDisablingStrategyObserver()
Method Detail

setController

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

Parameters:
controller - the controller which provides the DisablingStrategy

add

public void add(Dockable dockable)
Adds dockable to the set of dockables that must be observed

Parameters:
dockable - the new item

remove

public void remove(Dockable dockable)
Removes dockable from the set of dockables that must be observed

Parameters:
dockable - the item to remove

isDisabled

public boolean isDisabled(Dockable dockable)
Tells whether the tab of dockable is disabled.

Parameters:
dockable - the item to test
Returns:
whether the tab is disabled according to the current DisablingStrategy

setDisabled

public abstract void setDisabled(Dockable dockable,
                                 boolean disabled)
Called if dockable was enabled or disabled.

Parameters:
dockable - the elemnt whose state changed
disabled - the new state