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 Details

  • Method Details

    • addCommand

      public void addCommand​(IUndoableCommand command)
      Execute a command and push it to undo stack.
      Parameters:
      command - the command to be executed.
    • undoCommand

      public void undoCommand​(IUndoableCommand command)
      Undo the command. Restore the state of the target to the previous state before this command has been executed.
      Parameters:
      command -
    • redoCommand

      public void redoCommand​(IUndoableCommand command)
      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

      public void addListener​(IOperationsManagerListener listener)
    • removeListener

      public boolean removeListener​(IOperationsManagerListener listener)
    • getUndoCommandsSize

      public int getUndoCommandsSize()
    • getRedoCommandsSize

      public int getRedoCommandsSize()