eu.beesoft.gantt.action
Class AbstractTreeTableAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by eu.beesoft.gantt.action.AbstractGanttAction
          extended by eu.beesoft.gantt.action.AbstractTreeTableAction
All Implemented Interfaces:
LanguageListener, java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
Direct Known Subclasses:
CollapseAllNodesAction, CreateNodeAction, DeleteNodeAction, ExpandAllNodesAction, IndentNodeAction, MoveNodeDownAction, MoveNodeUpAction, UnindentNodeAction

public abstract class AbstractTreeTableAction
extends AbstractGanttAction

Abstract action to support gantt treetable operations.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractAction
enabled, changeSupport
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
AbstractTreeTableAction(JGantt component)
          Constructor.
 
Method Summary
protected  void clearSelection()
          Clears selection in tree table.
protected  GanttModel getGanttModel()
          Returns the instance of GanttModel.
protected  java.util.List<GanttNode> getSelectedNodes()
          Returns a list of selected instances of GanttNode (never null).
protected  GanttTreeTable getTreeTable()
          Returns the instance of GanttTreeTable.
protected  void insertNode(GanttNode node, GanttNode newParent, int index, UndoStep undo)
          Inserts given node into the specified position in the treetable hierarchy.
protected  void removeNode(GanttNode node, UndoStep undo)
          Removes given node from the treetable hierarchy.
protected  void selectNode(GanttNode node)
          Selects given node in tree table.
 
Methods inherited from class eu.beesoft.gantt.action.AbstractGanttAction
actionPerformed, executeAction, getGantt, getTextFromResourceBundle, languageChanged
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTreeTableAction

public AbstractTreeTableAction(JGantt component)
Constructor.

Parameters:
component - JGantt instance to which this action belongs
Method Detail

getTreeTable

protected GanttTreeTable getTreeTable()
Returns the instance of GanttTreeTable.

Returns:
the instance of GanttTreeTable

getGanttModel

protected GanttModel getGanttModel()
Returns the instance of GanttModel.

Returns:
the instance of GanttModel

getSelectedNodes

protected java.util.List<GanttNode> getSelectedNodes()
Returns a list of selected instances of GanttNode (never null).

Returns:
a list of selected gantt nodes

removeNode

protected void removeNode(GanttNode node,
                          UndoStep undo)
Removes given node from the treetable hierarchy.

Parameters:
node - - node to remove
undo - - register for undo / redo operations

insertNode

protected void insertNode(GanttNode node,
                          GanttNode newParent,
                          int index,
                          UndoStep undo)
Inserts given node into the specified position in the treetable hierarchy.

Parameters:
node - - node to insert
newParent - - new parent for node
index - - index in the new parent children list, where to insert object
undo - - register for undo / redo operations

clearSelection

protected void clearSelection()
Clears selection in tree table.


selectNode

protected void selectNode(GanttNode node)
Selects given node in tree table.

Parameters:
node - - node to select