bibliothek.gui.dock.action.actions
Class AbstractStandardDockAction

java.lang.Object
  extended by bibliothek.gui.dock.action.actions.AbstractStandardDockAction
All Implemented Interfaces:
DockAction, StandardDockAction
Direct Known Subclasses:
GroupedDockAction, SimpleDockAction

public abstract class AbstractStandardDockAction
extends java.lang.Object
implements StandardDockAction

An abstract implementation of the DockAction-interface. This implementation allows to register some StandardDockActionListener, and stores the Dockables which are using this action.

Author:
Benjamin Sigg

Field Summary
private  java.util.Map<Dockable,java.lang.Integer> binded
          All Dockables which can be used by this action
protected  java.util.List<StandardDockActionListener> listeners
          The listeners that are registered by this action
 
Constructor Summary
AbstractStandardDockAction()
           
 
Method Summary
 void addDockActionListener(StandardDockActionListener listener)
          Adds a listener to this DockAction.
 void bind(Dockable dockable)
          Informs this DockAction that icons, text, and other stuff like that, will be requested from this DockAction.
protected  void binded(Dockable dockable)
          Invoked by this AbstractStandardDockAction when a Dockable was binded to this action the first time.
protected  void fireActionDisabledIconChanged(java.util.Set<Dockable> dockables)
          Invokes the actionIconChanged- method of all currently registered StandardDockActionListener
protected  void fireActionEnabledChanged(java.util.Set<Dockable> dockables)
          Invokes the actionEnabledChanged- method of all currently registered StandardDockActionListener
protected  void fireActionIconChanged(java.util.Set<Dockable> dockables)
          Invokes the actionIconChanged- method of all currently registered StandardDockActionListener
protected  void fireActionTextChanged(java.util.Set<Dockable> dockables)
          Invokes the actionTextChanged- method of all currently registered StandardDockActionListener
protected  void fireActionTooltipTextChanged(java.util.Set<Dockable> dockables)
          Invokes the actionTooltipTextChanged- method of all currently registered StandardDockActionListener
 java.util.Set<Dockable> getBindeds()
          Gets a set of all Dockables which are currently binded to this DockAction.
 boolean isBinded(Dockable dockable)
          Tells whether the dockable is binded with this action, or not.
 void removeDockActionListener(StandardDockActionListener listener)
          Removes a listener from this DockStation.
 void unbind(Dockable dockable)
          Invoked only if the dockable was binded to this DockAction, and if the dockable will no longer be used for any method calls (except bind) on this DockAction.
protected  void unbinded(Dockable dockable)
          Called by this AbstractStandardDockAction when the Dockable dockable will not be used in any means by this action.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bibliothek.gui.dock.action.StandardDockAction
getDisabledIcon, getIcon, getText, getTooltipText, isEnabled
 
Methods inherited from interface bibliothek.gui.dock.action.DockAction
createView
 

Field Detail

listeners

protected java.util.List<StandardDockActionListener> listeners
The listeners that are registered by this action


binded

private java.util.Map<Dockable,java.lang.Integer> binded
All Dockables which can be used by this action

Constructor Detail

AbstractStandardDockAction

public AbstractStandardDockAction()
Method Detail

addDockActionListener

public void addDockActionListener(StandardDockActionListener listener)
Description copied from interface: StandardDockAction
Adds a listener to this DockAction. The listener should be triggered whenever an icon, a text, a tooltip, or the selected/enabled state changes.

Specified by:
addDockActionListener in interface StandardDockAction
Parameters:
listener - The listener to add

removeDockActionListener

public void removeDockActionListener(StandardDockActionListener listener)
Description copied from interface: StandardDockAction
Removes a listener from this DockStation. Note that this can happen at any time, even while this DockAction is sending an event.

Specified by:
removeDockActionListener in interface StandardDockAction
Parameters:
listener - The listener to remove

binded

protected void binded(Dockable dockable)
Invoked by this AbstractStandardDockAction when a Dockable was binded to this action the first time.

Parameters:
dockable - The Dockable that was not known to this action before the method was invoked

unbinded

protected void unbinded(Dockable dockable)
Called by this AbstractStandardDockAction when the Dockable dockable will not be used in any means by this action. Note that the binded(Dockable)-method can be invoked again with the dockable.

Parameters:
dockable - The Dockable which will not by used in any way.

isBinded

public boolean isBinded(Dockable dockable)
Tells whether the dockable is binded with this action, or not.

Parameters:
dockable - The Dockable to test
Returns:
true if it is binded, false otherwise

getBindeds

public java.util.Set<Dockable> getBindeds()
Gets a set of all Dockables which are currently binded to this DockAction.

Returns:
The binded Dockables

bind

public void bind(Dockable dockable)
Description copied from interface: DockAction
Informs this DockAction that icons, text, and other stuff like that, will be requested from this DockAction. This method should be called from the object that will display the view of this action.

Specified by:
bind in interface DockAction
Parameters:
dockable - The Dockable that may be used in the future
See Also:
DockAction.unbind(Dockable)

unbind

public void unbind(Dockable dockable)
Description copied from interface: DockAction
Invoked only if the dockable was binded to this DockAction, and if the dockable will no longer be used for any method calls (except bind) on this DockAction.

Specified by:
unbind in interface DockAction
Parameters:
dockable - The Dockable that will never be seen again, except it is maybe bind again.

fireActionTextChanged

protected void fireActionTextChanged(java.util.Set<Dockable> dockables)
Invokes the actionTextChanged- method of all currently registered StandardDockActionListener

Parameters:
dockables - The set of dockables for which the text has been changed.

fireActionTooltipTextChanged

protected void fireActionTooltipTextChanged(java.util.Set<Dockable> dockables)
Invokes the actionTooltipTextChanged- method of all currently registered StandardDockActionListener

Parameters:
dockables - The set of dockables for which the tooltip has been changed.

fireActionIconChanged

protected void fireActionIconChanged(java.util.Set<Dockable> dockables)
Invokes the actionIconChanged- method of all currently registered StandardDockActionListener

Parameters:
dockables - The set of dockables for which the icon has been changed.

fireActionDisabledIconChanged

protected void fireActionDisabledIconChanged(java.util.Set<Dockable> dockables)
Invokes the actionIconChanged- method of all currently registered StandardDockActionListener

Parameters:
dockables - The set of dockables for which the icon has been changed.

fireActionEnabledChanged

protected void fireActionEnabledChanged(java.util.Set<Dockable> dockables)
Invokes the actionEnabledChanged- method of all currently registered StandardDockActionListener

Parameters:
dockables - The set of dockables for which the enabled-state has been changed.