com.dlsc.flexgantt.command.treetable
Class DefaultChangeValueCommand

java.lang.Object
  extended by com.dlsc.flexgantt.command.AbstractCommand
      extended by com.dlsc.flexgantt.command.treetable.DefaultChangeValueCommand
All Implemented Interfaces:
ICommand, java.io.Serializable

public class DefaultChangeValueCommand
extends AbstractCommand

A command that will change a column value of a tree table node. This command can only be used in situations where the tree table model is an instance of DefaultTreeTableModel and the node implements ITreeTableNode.

Since:
1.0
Author:
Dirk Lemmermann
See Also:
INodeEditPolicy.isValueEditable(Object, com.dlsc.flexgantt.model.treetable.ITreeTableModel, int), INodeEditPolicy.getChangeValueCommand(Object, com.dlsc.flexgantt.model.treetable.ITreeTableModel, Object, int), Serialized Form

Constructor Summary
DefaultChangeValueCommand(DefaultMutableTreeTableNode node, DefaultTreeTableModel model, java.lang.Object value, int index)
          Constructs a new command.
 
Method Summary
 void executeCommand(IProgressMonitor monitor)
          Executes the command.
 DefaultTreeTableModel getModel()
          Returns the tree table model to which the node belongs.
 java.lang.Object getNewValue()
          Returns the new column value.
 ITreeTableNode getNode()
          Returns the node that was modified.
 java.lang.Object getOldValue()
          Returns the old column value.
 int getValueIndex()
          Returns the model index under which the new value gets stored.
 void undoCommand(IProgressMonitor monitor)
          Undos the command.
 
Methods inherited from class com.dlsc.flexgantt.command.AbstractCommand
getName, isRedoable, isRelevant, isUndoable, redoCommand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultChangeValueCommand

public DefaultChangeValueCommand(DefaultMutableTreeTableNode node,
                                 DefaultTreeTableModel model,
                                 java.lang.Object value,
                                 int index)
Constructs a new command.

Parameters:
node - the node that will be modified
model - the model to which the node belongs
value - the new column value
index - the model index where the column value will be set
Since:
1.0
See Also:
ITreeTableNode.setColumnValue(Object, int)
Method Detail

executeCommand

public void executeCommand(IProgressMonitor monitor)
Description copied from interface: ICommand
Executes the command.

Parameters:
monitor - a progress monitor

undoCommand

public void undoCommand(IProgressMonitor monitor)
Description copied from interface: ICommand
Undos the command.

Parameters:
monitor - a progress monitor

getModel

public DefaultTreeTableModel getModel()
Returns the tree table model to which the node belongs.

Returns:
the node's tree table model
Since:
1.0

getNode

public ITreeTableNode getNode()
Returns the node that was modified.

Returns:
the modified tree table node
Since:
1.0

getNewValue

public java.lang.Object getNewValue()
Returns the new column value.

Returns:
the node's new column value
Since:
1.0

getOldValue

public java.lang.Object getOldValue()
Returns the old column value.

Returns:
the node's old column value
Since:
1.0

getValueIndex

public int getValueIndex()
Returns the model index under which the new value gets stored.

Returns:
the value's model index
Since:
1.0