com.dlsc.flexgantt.command.layer

## Class DefaultDeleteTimelineObjectCommand

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

- All Implemented Interfaces:
    ICommand, Serializable

      public class DefaultDeleteTimelineObjectCommand
      extends AbstractCommand

  A command that deletes a timeline object from a Gantt chart model. This command will only work in situations where the model is an instance of `DefaultGanttChartModel`, the timeline object implements the `ITimelineObject` interface, and the tree node implements the `IGanttChartNode` interface.
  Since:
    1.0
  Version:
    $Revision: 1.6 $
  Author:
    Dirk Lemmermann
  See Also:
    `IEditTimelineObjectPolicy.getDeleteCommand(com.dlsc.flexgantt.model.gantt.IGanttChartModel, Collection)`, `DefaultGanttChartModel.removeTimelineObject(IGanttChartNode, ILayer, ITimelineObject)`, Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultDeleteTimelineObjectCommand(IGanttChartNode node, ILayer layer, ITimelineObject object, DefaultGanttChartModel model)` 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.
    `ILayer` | `getLayer()` Returns the layer on which the timeline object gets displayed.
    `DefaultGanttChartModel` | `getModel()` Returns the model in which the tree node and the deleted timeline object are stored.
    `IGanttChartNode` | `getNode()` Returns the tree node that owns the timeline object (the object gets shown in the row of that node).
    `ITimelineObject` | `getTimelineObject()` Returns the timeline object that will / was deleted.
    `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

    - #### DefaultDeleteTimelineObjectCommand

          public DefaultDeleteTimelineObjectCommand(IGanttChartNode node,
                                                    ILayer layer,
                                                    ITimelineObject object,
                                                    DefaultGanttChartModel model)

      Constructs a new command.
      Parameters:
        `node` - the tree node that owns the timeline object (the object is displayed in the row of that node)
        `layer` - the layer on which the timeline object gets displayed
        `object` - the timeline object that will be deleted
        `model` - the model in which the node and the timeline object are stored
      Since:
        1.0

  - ### 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

    - #### getTimelineObject

          public ITimelineObject getTimelineObject()

      Returns the timeline object that will / was deleted.
      Returns:
        the deleted timeline object
      Since:
        1.0

    - #### getModel

          public DefaultGanttChartModel getModel()

      Returns the model in which the tree node and the deleted timeline object are stored.
      Returns:
        the Gantt chart to which the tree node and the timeline object belong
      Since:
        1.0

    - #### getLayer

          public ILayer getLayer()

      Returns the layer on which the timeline object gets displayed.
      Returns:
        the layer on which the timeline object gets displayed
      Since:
        1.0

    - #### getNode

          public IGanttChartNode getNode()

      Returns the tree node that owns the timeline object (the object gets shown in the row of that node).
      Returns:
        the timeline object's node
      Since:
        1.0

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