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

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

public class CActionSource
extends AbstractDockActionSource

This DockActionSource handles CActions.

Author:
Benjamin Sigg

Field Summary
 
Fields inherited from class bibliothek.gui.dock.action.AbstractDockActionSource
listeners
 
Constructor Summary
CActionSource(LocationHint hint)
          Creates a new source.
 
Method Summary
 void add(CAction action)
          Adds an action to this source.
 CAction getAction(int index)
          Gets the index'th action of this source.
 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.
 void insert(int index, CAction action)
          Inserts an action at index of this source.
 java.util.Iterator<DockAction> iterator()
           
 boolean remove(CAction action)
          Removes action from this source.
 CAction remove(int index)
          Removes the action at index.
 CAction set(int index, CAction action)
          Replaces the action at index with index.
 
Methods inherited from class bibliothek.gui.dock.action.AbstractDockActionSource
addDockActionSourceListener, fireAdded, fireRemoved, indexOf, removeDockActionSourceListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CActionSource

public CActionSource(LocationHint hint)
Creates a new source.

Parameters:
hint - the location of this source
Method Detail

add

public void add(CAction action)
Adds an action to this source.

Parameters:
action - the new action, not null

insert

public void insert(int index,
                   CAction action)
Inserts an action at index of this source.

Parameters:
index - an index between 0 and getDockActionCount() (incl.)
action - the new action, not null

set

public CAction set(int index,
                   CAction action)
Replaces the action at index with index.

Parameters:
index - the index of the new action
action - the new action, not null
Returns:
the old action, may be null

remove

public CAction remove(int index)
Removes the action at index.

Parameters:
index - the index of the action to remove
Returns:
the removed action

remove

public boolean remove(CAction action)
Removes action from this source.

Parameters:
action - the action to remove
Returns:
true if the action was removed

getAction

public CAction getAction(int index)
Gets the index'th action of this source.

Parameters:
index - the index of some action
Returns:
the action, not null

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 java.util.Iterator<DockAction> iterator()