com.dlsc.flexgantt.command.treetable

## Class DefaultChangeValueCommand

- java.lang.Object
- - com.dlsc.flexgantt.command.AbstractCommand
  - - com.dlsc.flexgantt.command.treetable.DefaultChangeValueCommand

- All Implemented Interfaces:
    ICommand, 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
  Version:
    $Revision: 1.6 $
  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

    Constructors
    Constructor and Description
    `DefaultChangeValueCommand(DefaultMutableTreeTableNode node, DefaultTreeTableModel model, Object value, int index)` Constructs a new command.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `executeCommand(IProgressMonitor monitor)` Executes the command.
    `DefaultTreeTableModel` | `getModel()` Returns the tree table model to which the node belongs.
    `Object` | `getNewValue()` Returns the new column value.
    `ITreeTableNode` | `getNode()` Returns the node that was modified.
    `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, setName`

    - ### 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,
                                           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)
                              throws CommandException

      Description copied from interface: `ICommand`
      Executes the command.
      Parameters:
        `monitor` - a progress monitor
      Throws:
        `CommandException` - if anything during the execution of the command has gone wrong

    - #### undoCommand

          public void undoCommand(IProgressMonitor monitor)
                           throws CommandException

      Description copied from interface: `ICommand`
      Undos the command.
      Parameters:
        `monitor` - a progress monitor
      Throws:
        `CommandException` - if anything during the execution of the command has gone wrong

    - #### 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 Object getNewValue()

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

    - #### getOldValue

          public 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

Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.