represents an edit. The edit may be undone, or if already undone the edit may be redone.
UndoableEdit is designed to be used with the
UndoableEdits are generated by an
UndoableEditListener they are typically added to the
UndoManager. When an
UndoableEdit is added to an
UndoManager the following occurs (assuming
end has not been called on the
- If the
UndoManager contains edits it will call
addEdit on the current edit passing in the new edit as the argument. If
addEdit returns true the new edit is assumed to have been incorporated into the current edit and the new edit will not be added to the list of current edits. Edits can use
addEdit as a way for smaller edits to be incorporated into a larger edit and treated as a single edit.
addEdit returns false
replaceEdit is called on the new edit with the current edit passed in as the argument. This is the inverse of
addEdit if the new edit returns true from
replaceEdit, the new edit replaces the current edit.
makes use of
to determine how many edits should be undone or redone. The
will undo or redo all insignificant edits (
returns false) between the current edit and the last or next significant edit.
can be used to treat multiple edits as a single edit, returning false from
allows for treating can be used to have many smaller edits undone or redone at once. Similar functionality can also be done using the
@author Ray Ryan