Methods Summary |
---|
public synchronized boolean | addEdit(javax.swing.undo.UndoableEdit anEdit)
boolean b = super.addEdit(anEdit);
if (b)
support.postEdit(anEdit); // If the edit was added, notify listeners.
return b;
|
public synchronized void | addUndoableEditListener(javax.swing.event.UndoableEditListener l)
support.addUndoableEditListener(l);
|
public synchronized javax.swing.undo.UndoableEdit[] | getEdits() // The source of the last edit
// Return the complete list of edits in an array.
UndoableEdit[] array = new UndoableEdit[edits.size()];
edits.copyInto(array);
return array;
|
public synchronized javax.swing.undo.UndoableEdit[] | getRedoableEdits()
int size = edits.size();
Vector v = new Vector(size);
for (int i=0; i<size; i++) {
UndoableEdit u = (UndoableEdit)edits.elementAt(i);
if (u.canRedo() && u.isSignificant())
v.addElement(u);
}
UndoableEdit[] array = new UndoableEdit[v.size()];
v.copyInto(array);
return array;
|
public synchronized javax.swing.undo.UndoableEdit[] | getUndoableEdits()
int size = edits.size();
Vector v = new Vector(size);
for (int i=size-1;i>=0;i--) {
UndoableEdit u = (UndoableEdit)edits.elementAt(i);
if (u.canUndo() && u.isSignificant())
v.addElement(u);
}
UndoableEdit[] array = new UndoableEdit[v.size()];
v.copyInto(array);
return array;
|
public synchronized void | removeUndoableEditListener(javax.swing.event.UndoableEditListener l)
support.removeUndoableEditListener(l);
|
public synchronized void | undoableEditHappened(javax.swing.event.UndoableEditEvent ev)
UndoableEdit ue = ev.getEdit();
source = ev.getSource();
addEdit(ue);
|