|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.autodesk.undo.Undo
public class Undo
This class implements an undo/redo stack for the addition and deletion of Undoable objects. This class is NOT thread safe. Undo maintains two stacks. One is the main stack and the other is the current stack. While a user is operating on a widget their actions are saved in the current stack. When they switch to another widget the contents of the current stack are moved into the main stack and saved there as a group. What this means is that while the user is typing in a a widget each key press is saved and can be undone and redone. However when they switch to another widget this collection of key presses is saved to the main stack as a group so that the whole set of key presses is undone and redone as a group.
| Constructor Summary | |
|---|---|
Undo()
|
|
| Method Summary | |
|---|---|
void |
addUndoChangeListener(com.autodesk.undo.UndoChangeListener listener)
Add a UndoChangeListener that will be notified when the text has changed. |
boolean |
atMark()
Check if the undo queue is at it's marked position. |
boolean |
canRedo()
Determine if any redo's remain. |
boolean |
canUndo()
Determine if any undo's remain. |
void |
clear()
Clear the Undo stack. |
void |
commit(boolean group)
Commit the current stack to the main stack. |
void |
enable(boolean enable)
Enable or disable pushing onto the Undo stack. |
void |
endGroup()
Mark the end of a group of undo events on the stack. |
protected void |
fireMarkLeft()
Notify listeners that the mark has been left. |
protected void |
fireMarkVisited()
Notify listeners that the mark has been visited. |
void |
mark()
Mark the current position in the undo queue. |
void |
printUndoStack()
Print the contents of the Undo stack. |
void |
push(UndoableChange item)
Push a new item onto the stack. |
void |
redo()
Redo an undone operation. |
void |
removeUndoChangeListener(com.autodesk.undo.UndoChangeListener listener)
Remove a UndoChangeListener from this instance. |
void |
startGroup()
Mark the start of a group of undo events on the stack. |
void |
undo()
Undo an operation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Undo()
| Method Detail |
|---|
public void push(UndoableChange item)
public void commit(boolean group)
group - if true then whatever is on the
current undo stack will be grouped so that they will be
undone and redone together, apparently as a single event.public void enable(boolean enable)
public void clear()
public boolean canUndo()
public boolean canRedo()
public void startGroup()
public void endGroup()
public void undo()
public void redo()
public void printUndoStack()
public void mark()
public boolean atMark()
public void addUndoChangeListener(com.autodesk.undo.UndoChangeListener listener)
listener - the UndoChangeListener to add. May not be null.public void removeUndoChangeListener(com.autodesk.undo.UndoChangeListener listener)
listener - the UndoChangeListener to remove. May not be null.protected void fireMarkVisited()
protected void fireMarkLeft()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||