com.dlsc.flexgantt.command
Interface ICommand

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
AbstractCommand, AbstractDragAndDropCommand, CompoundCommand, DefaultAddLayerCommand, DefaultChangeCapacityCommand, DefaultChangeEventlineObjectTimeSpanCommand, DefaultChangeKeyCommand, DefaultChangePercentageCommand, DefaultChangeTimelineObjectTimeSpanCommand, DefaultChangeTimeZoneCommand, DefaultChangeValueCommand, DefaultCreateEventlineObjectCommand, DefaultCreateRelationshipCommand, DefaultCreateTimelineObjectCommand, DefaultDeleteEventlineObjectCommand, DefaultDeleteTimelineObjectCommand, DefaultDragAndDropCommand, DefaultMultiDragAndDropCommand, DefaultNodeCreateCommand, DefaultNodeDeleteCommand, DefaultNodeDragAndDropCommand, DefaultRemoveLayerCommand, DefaultRowResizeCommand

public interface ICommand
extends java.io.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
Author:
Dirk Lemmermann
See Also:
AbstractCommand, ICommandStack, DefaultCommandStack

Method Summary
 void executeCommand(IProgressMonitor monitor)
          Executes the command.
 java.lang.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)
Executes the command.

Parameters:
monitor - a progress monitor
Since:
1.0

undoCommand

void undoCommand(IProgressMonitor monitor)
Undos the command.

Parameters:
monitor - a progress monitor
Since:
1.0

redoCommand

void redoCommand(IProgressMonitor monitor)
Redos the command.

Parameters:
monitor - a progress monitor
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

java.lang.String getName()
The name of the command.

Returns:
the command's name
Since:
1.0