com.dlsc.flexgantt.command

## Interface ICommand

- All Superinterfaces:
    Serializable
  All Known Implementing Classes:
    AbstractCommand, AbstractCompoundCommand, AbstractDragAndDropCommand, DefaultAddLayerCommand, DefaultChangeCapacityCommand, DefaultChangeEventlineObjectTimeSpanCommand, DefaultChangeKeyCommand, DefaultChangeMultipleTimelineObjectsTimeSpanCommand, DefaultChangePercentageCommand, DefaultChangeSpreadsheetValueCommand, DefaultChangeTimelineObjectTimeSpanCommand, DefaultChangeTimeZoneCommand, DefaultChangeValueCommand, DefaultCreateConstraintCommand, DefaultCreateEventlineObjectCommand, DefaultCreateMultipleTimelineObjectsCommand, DefaultCreateNodeCommand, DefaultCreateRelationshipCommand, DefaultCreateTimelineObjectCommand, DefaultDeleteEventlineObjectCommand, DefaultDeleteMultipleEventlineObjectsCommand, DefaultDeleteMultipleNodesCommand, DefaultDeleteMultipleRelationshipsCommand, DefaultDeleteMultipleTimelineObjectsCommand, DefaultDeleteNodeCommand, DefaultDeleteRelationshipCommand, DefaultDeleteTimelineObjectCommand, DefaultDragAndDropCommand, DefaultInsertNodeCommand, DefaultMultiDragAndDropCommand, DefaultNodeDragAndDropCommand, DefaultReassignNodesCommand, DefaultRemoveLayerCommand, DefaultRowResizeCommand

      public interface ICommand
      extends Serializable

  This interface needs to be implemented by any command that needs to be executed in the context of a Gantt chart. Any command is free to specify whether it can be undone and/or redone. Note: it is important to mention that a command does not ensure transactional integrity. A command will not attempt a rollback or any other strategy in order to get back to the application's state before the command started its execution. This piece of functionality needs to be provided by the individual commands and the API used to retrieve data from the backend (SQL for example).
  Since:
    1.0
  Version:
    $Revision: 1.7 $
  Author:
    Dirk Lemmermann
  See Also:
    `AbstractCommand`, `ICommandStack`, `DefaultCommandStack`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `executeCommand(IProgressMonitor monitor)` Executes the command.
    `String` | `getName()` The name of the command.
    `boolean` | `isRedoable()` Returns true if the command can be redone.
    `boolean` | `isRelevant()` Determines whether the command is relevant for undo / redo operations.
    `boolean` | `isUndoable()` Returns true if the command can be undone.
    `void` | `redoCommand(IProgressMonitor monitor)` Redos the command.
    `void` | `undoCommand(IProgressMonitor monitor)` Undos the command.

- - ### Method Detail

    - #### executeCommand

          void executeCommand(IProgressMonitor monitor)
                       throws CommandException

      Executes the command.
      Parameters:
        `monitor` - a progress monitor
      Throws:
        `CommandException` - if anything during the execution of the command has gone wrong
      Since:
        1.0

    - #### undoCommand

          void undoCommand(IProgressMonitor monitor)
                    throws CommandException

      Undos the command.
      Parameters:
        `monitor` - a progress monitor
      Throws:
        `CommandException` - if anything during the execution of the command has gone wrong
      Since:
        1.0

    - #### redoCommand

          void redoCommand(IProgressMonitor monitor)
                    throws CommandException

      Redos the command.
      Parameters:
        `monitor` - a progress monitor
      Throws:
        `CommandException` - if anything during the execution of the command has gone wrong
      Since:
        1.0

    - #### isRelevant

          boolean isRelevant()

      Determines whether the command is relevant for undo / redo operations. Commands that are not conisdered to be relevant will not be added to the list of commands that can be undone but they also do not invalidate that list and the command stack remains undoable if it was undoable before.
      Returns:
        TRUE if the command is relevant
      Since:
        1.0

    - #### isUndoable

          boolean isUndoable()

      Returns true if the command can be undone.
      Returns:
        true if the command is undoable
      Since:
        1.0

    - #### isRedoable

          boolean isRedoable()

      Returns true if the command can be redone.
      Returns:
        true if the command is redoable
      Since:
        1.0

    - #### getName

          String getName()

      The name of the command.
      Returns:
        the command's name
      Since:
        1.0

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