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
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 bound(Dockable dockable)
          Invoked by this AbstractStandardDockAction when a Dockable was bound 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 fireActionRepresentativeChanged(java.util.Set<Dockable> dockables)
          Invokes the actionRepresentativeChanged- 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> getBoundDockables()
          Gets a set of all Dockables which are currently bound to this DockAction.
 boolean isBound(Dockable dockable)
          Tells whether the dockable is bound 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 bound to this DockAction, and if the dockable will no longer be used for any method calls (except bind) on this DockAction.
protected  void unbound(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, getDockableRepresentation, getIcon, getText, getTooltipText, isEnabled
 
Methods inherited from interface bibliothek.gui.dock.action.DockAction
createView, trigger
 

Field Detail

listeners

protected java.util.List<StandardDockActionListener> listeners
The listeners that are registered 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

bound

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

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

unbound

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

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

isBound

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

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

getBoundDockables

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

Returns:
The bound 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 bound 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.

fireActionRepresentativeChanged

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

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