bibliothek.gui.dock.common.intern.action
Class CloseActionSource

java.lang.Object
  extended by bibliothek.gui.dock.action.AbstractDockActionSource
      extended by bibliothek.gui.dock.common.intern.action.CloseActionSource
All Implemented Interfaces:
DockActionSource, Iterable<DockAction>

public class CloseActionSource
extends AbstractDockActionSource

An action source that observes one CDockable and either adds or removes a close-action from itself.

Author:
Benjamin Sigg

Field Summary
 
Fields inherited from class bibliothek.gui.dock.action.AbstractDockActionSource
listeners
 
Constructor Summary
CloseActionSource(CDockable dockable)
          Creates a new source
 
Method Summary
 DockAction getDockAction(int index)
          Gets the index'th DockAction of this source.
 int getDockActionCount()
          Gets the number of DockActions which are provided by this source.
 LocationHint getLocationHint()
          Gets a hint where to put this source in relation to other sources.
 Iterator<DockAction> iterator()
           
 void setControl(CControlAccess control)
          Grants access to the CControl and allows to create the default action.
protected  void update()
          Called when the content of this source needs to be updated.
 
Methods inherited from class bibliothek.gui.dock.action.AbstractDockActionSource
addDockActionSourceListener, fireAdded, fireRemoved, hasListeners, indexOf, removeDockActionSourceListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CloseActionSource

public CloseActionSource(CDockable dockable)
Creates a new source

Parameters:
dockable - the element which will be observed for changes
Method Detail

setControl

public void setControl(CControlAccess control)
Grants access to the CControl and allows to create the default action.

Parameters:
control - the access or null

update

protected void update()
Called when the content of this source needs to be updated.


getDockAction

public DockAction getDockAction(int index)
Description copied from interface: DockActionSource
Gets the index'th DockAction of this source.

Parameters:
index - The index of the action
Returns:
The DockAction

getDockActionCount

public int getDockActionCount()
Description copied from interface: DockActionSource
Gets the number of DockActions which are provided by this source.

Returns:
The number of DockActions

getLocationHint

public LocationHint getLocationHint()
Description copied from interface: DockActionSource
Gets a hint where to put this source in relation to other sources. Note that an ActionOffer can choose to ignore these hints, or interpret them in an unexpected way.

Returns:
the preferred location of this source

iterator

public Iterator<DockAction> iterator()