- java.lang.Object
-
- org.icepdf.ri.common.UndoCaretaker
-
public class UndoCaretaker extends Object
Undo caretaker implementation for the Viewer RI. Currently only annotation can be manipulate but this class can easily handle any class that implements the Memento interfce.- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description UndoCaretaker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddState(Memento previousState, Memento newState)Adds the give states to the history list.booleanisRedo()Gets the status of the redo command.booleanisUndo()Gets the status of the undo command.Mementoredo()Redo the last state change.Mementoundo()Undo the last state change.
-
-
-
Method Detail
-
undo
public Memento undo()
Undo the last state change. Only possible if there are items in the undo history list.
-
isUndo
public boolean isUndo()
Gets the status of the undo command.- Returns:
- true if an undo command is possible, false if undo can not be done.
-
redo
public Memento redo()
Redo the last state change. ONly possible if there have been previous undo call.
-
isRedo
public boolean isRedo()
Gets the status of the redo command.- Returns:
- true if an redo command is possible, false if the redo can not be done.
-
-