Class NoopUndoManager

java.lang.Object
com.levigo.jadice.web.client.undo.NoopUndoManager
All Implemented Interfaces:
UndoManager

public class NoopUndoManager extends Object implements UndoManager
An implementation of UndoManager that does nothing.
  • Constructor Details

    • NoopUndoManager

      public NoopUndoManager()
  • Method Details

    • clear

      public void clear()
      Description copied from interface: UndoManager
      Clear the undo and redo stacks.
      Specified by:
      clear in interface UndoManager
    • undo

      public void undo() throws CannotUndoException
      Description copied from interface: UndoManager
      Undo the edit at the top of the undo stack.
      Specified by:
      undo in interface UndoManager
      Throws:
      CannotUndoException - if the stack is empty or the edit cannot be undone for some other reason.
    • canUndo

      public boolean canUndo()
      Description copied from interface: UndoManager
      Determine whether there is currently something to undo.
      Specified by:
      canUndo in interface UndoManager
      Returns:
      true if there is
    • redo

      public void redo() throws CannotRedoException
      Description copied from interface: UndoManager
      Redo the edit at the top of the redo stack.
      Specified by:
      redo in interface UndoManager
      Throws:
      CannotRedoException - if the stack is empty or the edit cannot be re-done for some other reason.
    • canRedo

      public boolean canRedo()
      Description copied from interface: UndoManager
      Determine whether there is currently something to redo.
      Specified by:
      canRedo in interface UndoManager
      Returns:
      true if there is
    • addEdit

      public boolean addEdit(UndoableEdit anEdit)
      Description copied from interface: UndoManager
      Add an undoable edit to the undo stack. This can happen in one of two ways:
      • The edit could not be merged into the element currently at the top of the stack either because the stack was empty or because the UndoableEdit.tryMergeInto(UndoableEdit) returned false. In this case the new edit is simply added to the stack.
      • The edit could me berged.
      Specified by:
      addEdit in interface UndoManager
      Parameters:
      anEdit - the edit
      Returns:
      true if the edit was merged into the edit at the top of the stack, false otherwise.
    • getUndoDescription

      public String getUndoDescription()
      Description copied from interface: UndoManager
      Get the human-readable description of the edit at the top of the undo stack. It is provided by delegating to UndoableEdit.getUndoDescription().
      Specified by:
      getUndoDescription in interface UndoManager
      Returns:
      the description or null if the undo stack is empty.
    • getRedoDescription

      public String getRedoDescription()
      Description copied from interface: UndoManager
      Get the human-readable description of the edit at the top of the redo stack. It is provided by delegating to UndoableEdit.getRedoDescription().
      Specified by:
      getRedoDescription in interface UndoManager
      Returns:
      the description or null if the redo stack is empty.
    • addOnUndoStackUpdatedHandler

      public void addOnUndoStackUpdatedHandler(OnUndoStackUpdatedHandler handler)
      Description copied from interface: UndoManager
      Adds a handler that is called whenever the undo/redo item lists are updated.
      Specified by:
      addOnUndoStackUpdatedHandler in interface UndoManager
      Parameters:
      handler - The handler to add.
    • removeOnUndoStackUpdatedHandler

      public void removeOnUndoStackUpdatedHandler(OnUndoStackUpdatedHandler handler)
      Description copied from interface: UndoManager
      Removes a handler that is called whenever the undo/redo item lists are updated.
      Specified by:
      removeOnUndoStackUpdatedHandler in interface UndoManager
      Parameters:
      handler - The handler to remove.
    • clearOnUndoStackUpdateHandlers

      public void clearOnUndoStackUpdateHandlers()
      Description copied from interface: UndoManager
      Removes all handlers that are called whenever the undo/redo item lists are updated.
      Specified by:
      clearOnUndoStackUpdateHandlers in interface UndoManager