com.dlsc.flexgantt.command.layer

## Class DefaultChangeSpreadsheetValueCommand

- java.lang.Object
- - com.dlsc.flexgantt.command.AbstractCommand
  - - com.dlsc.flexgantt.command.layer.DefaultChangeSpreadsheetValueCommand

- All Implemented Interfaces:
    ICommand, Serializable

      public class DefaultChangeSpreadsheetValueCommand
      extends AbstractCommand

  A command that will change the value of a spreadsheet cell. This command will only work if the model is an instance of `DefaultGanttChartModel` and the tree / hierarchy node implements the `IGanttChartNode` interface. Spreadsheet cells are defined by their time span (x-coordinate) and their tree node (y-coordinate).
  Since:
    2.1
  Author:
    Dirk Lemmermann
  See Also:
    `ISpreadsheetEditPolicy.getChangeSpreadsheetValueCommand(com.dlsc.flexgantt.model.gantt.IGanttChartModel, Object, ISpreadsheet, ITimeSpan, Object)`, `IGanttChartNode.setSpreadsheetValue(ISpreadsheet, Object, ITimeSpan)`, Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultChangeSpreadsheetValueCommand(DefaultGanttChartModel model, IGanttChartNode node, ISpreadsheet spreadsheet, ITimeSpan span, Object value)` 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.
    `DefaultGanttChartModel` | `getModel()` Returns the spreadsheet model to which the cell belongs.
    `Object` | `getNewValue()` Returns the new value that will be assigned to the spreadsheet cell.
    `IGanttChartNode<?>` | `getNode()` Returns the node (the y-coordinate) of the spreadsheet cell.
    `Object` | `getOldValue()` Returns the old value that was assigned to the spreadsheet cell.
    `ITimeSpan` | `getTimeSpan()` Returns the time span (the x-coordinate) of the spreadsheet cell.
    `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

    - #### DefaultChangeSpreadsheetValueCommand

          public DefaultChangeSpreadsheetValueCommand(DefaultGanttChartModel model,
                                                      IGanttChartNode node,
                                                      ISpreadsheet spreadsheet,
                                                      ITimeSpan span,
                                                      Object value)

      Constructs a new command.
      Parameters:
        `model` - the Gantt chart model on which the value of the spreadsheet cell is stored
        `node` - the node (y-coordinate) of the spreadsheet cell
        `spreadsheet` - the spreadsheet that is being edited
        `span` - the time span (x-coordinate) of the spreadsheet cell
        `value` - the new value that will be given to the spreadsheet cell
      Since:
        2.1

  - ### 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 DefaultGanttChartModel getModel()

      Returns the spreadsheet model to which the cell belongs.
      Returns:
        the cell's spreadsheet model
      Since:
        2.1

    - #### getNewValue

          public Object getNewValue()

      Returns the new value that will be assigned to the spreadsheet cell.
      Returns:
        the new spreadsheet cell
      Since:
        2.1

    - #### getOldValue

          public Object getOldValue()

      Returns the old value that was assigned to the spreadsheet cell.
      Returns:
        the old value stored in the spreadsheet cell
      Since:
        2.1

    - #### getNode

          public IGanttChartNode<?> getNode()

      Returns the node (the y-coordinate) of the spreadsheet cell.
      Returns:
        the cell's tree / hierarchy node
      Since:
        2.1

    - #### getTimeSpan

          public ITimeSpan getTimeSpan()

      Returns the time span (the x-coordinate) of the spreadsheet cell.
      Returns:
        the cell's time span
      Since:
        2.1

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