|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ix.iview.UndoManager
public class UndoManager
A manager that keeps track of objects' edits for undo/redo purposes. Keeps a current object and its edits. Keeps a list of undos for each object that has been edited. To use an UndoManager, do the following:
Nested Class Summary | |
---|---|
protected class |
UndoManager.UndoNote
|
Field Summary | |
---|---|
protected EditableObject |
currentObject
|
protected java.util.ArrayList |
currentUndos
A list of slot / previous value pairs for the current object |
protected int |
undoIndex
|
protected boolean |
undoing
|
protected java.util.HashMap |
undoObjects
a map of undos for previously edited objects |
Constructor Summary | |
---|---|
UndoManager(UndoEditing editor)
Creates an undo manager with the given source of the editing for data lookup and setting. |
Method Summary | |
---|---|
void |
addUndoListener(UndoChangeListener listener)
|
boolean |
canRedo()
|
boolean |
canUndo()
|
void |
clearUndos()
|
void |
constructChanged(java.awt.Component source,
UIObject oldUIO,
UIObject newUIO)
Implement this method to take note of action selections |
void |
dataChanged(EditableObject object,
java.lang.String field,
java.lang.Object oldValue,
java.lang.Object newValue)
make sure you only call this if data really has changed! |
void |
ensureConstructSet(EditableObject uio)
|
protected void |
fireUndoChange()
|
boolean |
isUndoing()
Checks if the manager is currently undoing a change |
void |
noteUndo(EditableObject uio,
java.lang.String field,
java.lang.Object oldValue,
java.lang.Object newValue)
Notes an undoable change. |
boolean |
redo()
Redoes a change that has previously been undone. |
boolean |
redo(EditableObject uio)
As above, but for a given object. |
void |
setConstruct(EditableObject uio)
|
void |
test()
|
boolean |
undo()
Undoes an undoable change. |
boolean |
undo(EditableObject uio)
As above, but for a given object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.ArrayList currentUndos
protected EditableObject currentObject
protected boolean undoing
protected int undoIndex
protected java.util.HashMap undoObjects
Constructor Detail |
---|
public UndoManager(UndoEditing editor)
Method Detail |
---|
public boolean isUndoing()
public void noteUndo(EditableObject uio, java.lang.String field, java.lang.Object oldValue, java.lang.Object newValue)
public boolean undo()
public boolean undo(EditableObject uio)
public boolean redo()
public boolean redo(EditableObject uio)
public void clearUndos()
public void ensureConstructSet(EditableObject uio)
public void setConstruct(EditableObject uio)
public boolean canUndo()
public boolean canRedo()
public void dataChanged(EditableObject object, java.lang.String field, java.lang.Object oldValue, java.lang.Object newValue)
dataChanged
in interface DataChangeListener
public void constructChanged(java.awt.Component source, UIObject oldUIO, UIObject newUIO)
CurrentConstructListener
constructChanged
in interface CurrentConstructListener
source
- the component that changed the actionpublic void test()
protected void fireUndoChange()
public void addUndoListener(UndoChangeListener listener)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |