org.icepdf.ri.common
Class UndoCaretaker

java.lang.Object
  extended by org.icepdf.ri.common.UndoCaretaker

public class UndoCaretaker
extends java.lang.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
UndoCaretaker()
           
 
Method Summary
 void addState(org.icepdf.core.Memento previousState, org.icepdf.core.Memento newState)
          Adds the give states to the history list.
 boolean isRedo()
          Gets the status of the redo command.
 boolean isUndo()
          Gets the status of the undo command.
 void redo()
          Redo the last state change.
 void undo()
          Undo the last state change.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UndoCaretaker

public UndoCaretaker()
Method Detail

undo

public void 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 void 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.

addState

public void addState(org.icepdf.core.Memento previousState,
                     org.icepdf.core.Memento newState)
Adds the give states to the history list.

Parameters:
previousState - previous state
newState - new state.