bibliothek.gui.dock.disable
Class ActionDisablingStrategyObserver

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

public abstract class ActionDisablingStrategyObserver
extends Object

This class offers a convenient way to connect a DockAction with the current DisablingStrategy. It only requires the DockAction to call bind(Dockable) and unbind(Dockable) in order to observe a Dockable.

Author:
Benjamin Sigg

Constructor Summary
ActionDisablingStrategyObserver(DockAction action)
          Creates a new observer.
 
Method Summary
 void bind(Dockable dockable)
          Must be called to inform this observer that dockable is to be observed.
 boolean isDisabled(Dockable dockable)
          Tells whether the action of dockable is disabled.
protected abstract  void setDisabled(Dockable dockable, boolean disabled)
          Called if the disabled state of the action changed.
protected abstract  void setDisabled(Set<Dockable> dockable, boolean disabled)
          Called if an entire set of Dockables changed their state.
 void unbind(Dockable dockable)
          Must be called to inform this observer that dockable is no longer to be observed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionDisablingStrategyObserver

public ActionDisablingStrategyObserver(DockAction action)
Creates a new observer.

Parameters:
action - the action whose disabled state will be monitored.
Method Detail

bind

public void bind(Dockable dockable)
Must be called to inform this observer that dockable is to be observed. Can be called multiple times.

Parameters:
dockable - the item to observe

unbind

public void unbind(Dockable dockable)
Must be called to inform this observer that dockable is no longer to be observed. Can be called multiple times.

Parameters:
dockable - the item to observe

setDisabled

protected abstract void setDisabled(Dockable dockable,
                                    boolean disabled)
Called if the disabled state of the action changed.

Parameters:
dockable - the dockable for which the state changed
disabled - the new state

setDisabled

protected abstract void setDisabled(Set<Dockable> dockable,
                                    boolean disabled)
Called if an entire set of Dockables changed their state.

Parameters:
dockable - the items that changed their state
disabled - the new state

isDisabled

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

Parameters:
dockable - the element whose action state is searched
Returns:
true if the action is disabled, false otherwise