Class OperationsManager
java.lang.Object
org.eclipse.nebula.visualization.internal.xygraph.undo.OperationsManager
public class OperationsManager
extends java.lang.Object
The operation manager will help to manage the undoable and redoable
operations.
-
Constructor Summary
Constructors Constructor Description OperationsManager()
Constructor. -
Method Summary
Modifier and Type Method Description void
addCommand(IUndoableCommand command)
Execute a command and push it to undo stack.void
addListener(IOperationsManagerListener listener)
java.lang.Object[]
getRedoCommands()
int
getRedoCommandsSize()
java.lang.Object[]
getUndoCommands()
int
getUndoCommandsSize()
void
redo()
redo the last undone command.void
redoCommand(IUndoableCommand command)
Re-do the command.boolean
removeListener(IOperationsManagerListener listener)
void
undo()
undo the last command.void
undoCommand(IUndoableCommand command)
Undo the command.
-
Constructor Details
-
OperationsManager
public OperationsManager()Constructor.
-
-
Method Details
-
addCommand
Execute a command and push it to undo stack.- Parameters:
command
- the command to be executed.
-
undoCommand
Undo the command. Restore the state of the target to the previous state before this command has been executed.- Parameters:
command
-
-
redoCommand
Re-do the command. Restore the state of the target to the state after this command has been executed.- Parameters:
command
-
-
undo
public void undo()undo the last command. Do nothing if there is no last command. -
redo
public void redo()redo the last undone command. Do nothing if there is no last undone command. -
getUndoCommands
public java.lang.Object[] getUndoCommands()- Returns:
- the undo commands array. The first element is the oldest commands and the last element is the latest commands.
-
getRedoCommands
public java.lang.Object[] getRedoCommands()- Returns:
- the redo commands array. The first element is the oldest commands and the last element is the latest commands.
-
addListener
-
removeListener
-
getUndoCommandsSize
public int getUndoCommandsSize() -
getRedoCommandsSize
public int getRedoCommandsSize()
-