Class NoopUndoManager
java.lang.Object
com.levigo.jadice.web.client.undo.NoopUndoManager
- All Implemented Interfaces:
UndoManager
An implementation of
UndoManager that does nothing.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddEdit(UndoableEdit anEdit) Add an undoable edit to the undo stack.voidAdds a handler that is called whenever the undo/redo item lists are updated.booleancanRedo()Determine whether there is currently something to redo.booleancanUndo()Determine whether there is currently something to undo.voidclear()Clear the undo and redo stacks.voidRemoves all handlers that are called whenever the undo/redo item lists are updated.Get the human-readable description of the edit at the top of the redo stack.Get the human-readable description of the edit at the top of the undo stack.voidredo()Redo the edit at the top of the redo stack.voidRemoves a handler that is called whenever the undo/redo item lists are updated.voidundo()Undo the edit at the top of the undo stack.
-
Constructor Details
-
NoopUndoManager
public NoopUndoManager()
-
-
Method Details
-
clear
public void clear()Description copied from interface:UndoManagerClear the undo and redo stacks.- Specified by:
clearin interfaceUndoManager
-
undo
Description copied from interface:UndoManagerUndo the edit at the top of the undo stack.- Specified by:
undoin interfaceUndoManager- 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:UndoManagerDetermine whether there is currently something to undo.- Specified by:
canUndoin interfaceUndoManager- Returns:
trueif there is
-
redo
Description copied from interface:UndoManagerRedo the edit at the top of the redo stack.- Specified by:
redoin interfaceUndoManager- 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:UndoManagerDetermine whether there is currently something to redo.- Specified by:
canRedoin interfaceUndoManager- Returns:
trueif there is
-
addEdit
Description copied from interface:UndoManagerAdd 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)returnedfalse. In this case the new edit is simply added to the stack. - The edit could me berged.
- Specified by:
addEditin interfaceUndoManager- Parameters:
anEdit- the edit- Returns:
trueif the edit was merged into the edit at the top of the stack,falseotherwise.
- 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
-
getUndoDescription
Description copied from interface:UndoManagerGet the human-readable description of the edit at the top of the undo stack. It is provided by delegating toUndoableEdit.getUndoDescription().- Specified by:
getUndoDescriptionin interfaceUndoManager- Returns:
- the description or
nullif the undo stack is empty.
-
getRedoDescription
Description copied from interface:UndoManagerGet the human-readable description of the edit at the top of the redo stack. It is provided by delegating toUndoableEdit.getRedoDescription().- Specified by:
getRedoDescriptionin interfaceUndoManager- Returns:
- the description or
nullif the redo stack is empty.
-
addOnUndoStackUpdatedHandler
Description copied from interface:UndoManagerAdds a handler that is called whenever the undo/redo item lists are updated.- Specified by:
addOnUndoStackUpdatedHandlerin interfaceUndoManager- Parameters:
handler- The handler to add.
-
removeOnUndoStackUpdatedHandler
Description copied from interface:UndoManagerRemoves a handler that is called whenever the undo/redo item lists are updated.- Specified by:
removeOnUndoStackUpdatedHandlerin interfaceUndoManager- Parameters:
handler- The handler to remove.
-
clearOnUndoStackUpdateHandlers
public void clearOnUndoStackUpdateHandlers()Description copied from interface:UndoManagerRemoves all handlers that are called whenever the undo/redo item lists are updated.- Specified by:
clearOnUndoStackUpdateHandlersin interfaceUndoManager
-