public class UndoManager
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected java.util.ArrayList<UndoableEdit> |
m_edits |
Constructor and Description |
---|
UndoManager()
Constructs a new instance of UndoManager.
|
Modifier and Type | Method and Description |
---|---|
void |
addEdit(UndoableEdit edit)
Adds an UndoableEdit to UndoManager.
|
boolean |
canRedo()
Determines whether redo is possible.
|
boolean |
canUndo()
Determines whether undo is possible.
|
UndoableEdit |
current()
Gets the current UndoableEdit
|
void |
discardAllEdits()
Removes all UndoableEdits.
|
protected int |
getUndoLimits()
Returns the maximum number of undo(s)/redo(s).
|
UndoableEdit |
redo()
Performs an redo action.
|
UndoableEdit |
undo()
Performs an undo action.
|
protected java.util.ArrayList<UndoableEdit> m_edits
protected int getUndoLimits()
public boolean canUndo()
true
if undo is possible, false
otherwise.public boolean canRedo()
true
if redo is possible, false
otherwise.public void addEdit(UndoableEdit edit)
edit
- the UndoableEdit to register with the UndoManager.public UndoableEdit undo()
null
if no action needs to be taken.public UndoableEdit redo()
null
if no action needs to be taken.public void discardAllEdits()
public UndoableEdit current()