Methods Summary |
---|
protected void | _postEdit(javax.swing.undo.UndoableEdit e)Called only from postEdit and endUpdate . Calls
undoableEditHappened in all listeners. No synchronization
is performed here, since the two calling methods are synchronized.
UndoableEditEvent ev = new UndoableEditEvent(realSource, e);
Enumeration cursor = ((Vector)listeners.clone()).elements();
while (cursor.hasMoreElements()) {
((UndoableEditListener)cursor.nextElement()).
undoableEditHappened(ev);
}
|
public synchronized void | addUndoableEditListener(javax.swing.event.UndoableEditListener l)Registers an UndoableEditListener .
The listener is notified whenever an edit occurs which can be undone.
listeners.addElement(l);
|
public synchronized void | beginUpdate()
if (updateLevel == 0) {
compoundEdit = createCompoundEdit();
}
updateLevel++;
|
protected javax.swing.undo.CompoundEdit | createCompoundEdit()Called only from beginUpdate .
Exposed here for subclasses' use.
return new CompoundEdit();
|
public synchronized void | endUpdate()DEADLOCK WARNING: Calling this method may call
undoableEditHappened in all listeners.
It is unwise to call this method from one of its listeners.
updateLevel--;
if (updateLevel == 0) {
compoundEdit.end();
_postEdit(compoundEdit);
compoundEdit = null;
}
|
public synchronized javax.swing.event.UndoableEditListener[] | getUndoableEditListeners()Returns an array of all the UndoableEditListener s added
to this UndoableEditSupport with addUndoableEditListener().
return (UndoableEditListener[])(listeners.toArray(
new UndoableEditListener[0]));
|
public int | getUpdateLevel()Returns the update level value.
return updateLevel;
|
public synchronized void | postEdit(javax.swing.undo.UndoableEdit e)DEADLOCK WARNING: Calling this method may call
undoableEditHappened in all listeners.
It is unwise to call this method from one of its listeners.
if (updateLevel == 0) {
_postEdit(e);
} else {
// PENDING(rjrjr) Throw an exception if this fails?
compoundEdit.addEdit(e);
}
|
public synchronized void | removeUndoableEditListener(javax.swing.event.UndoableEditListener l)Removes an UndoableEditListener .
listeners.removeElement(l);
|
public java.lang.String | toString()Returns a string that displays and identifies this
object's properties.
return super.toString() +
" updateLevel: " + updateLevel +
" listeners: " + listeners +
" compoundEdit: " + compoundEdit;
|