public class IlvSDMUndoManager extends UndoManager
IlvSDMUndoManager
provides undo/redo capabilities for an
SDM engine.
The SDM undo manager adds a filtering data model
on top of the existing data model of the SDM engine.
This filtering model captures all the modifications
made to the underlying model, and stores them as
UndoableEdits in a Swing UndoManager.
To enable undo in an SDM engine,
create an IlvSDMUndoManager
associated with the engine.
You can also register UndoableEditListener
objects to be notified when an edit has happened and
update your GUI accordingly (for example, to gray out
undo/redo buttons).
| Modifier and Type | Class and Description |
|---|---|
static class |
IlvSDMUndoManager.UndoSDMModel
This class is the filtering SDM data model that records
in the undo manager all the editing calls on the underlying
data model.
|
editsRedoName, UndoName| Constructor and Description |
|---|
IlvSDMUndoManager(IlvSDMEngine engine)
Creates a new undo manager for the specified SDM engine.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addUndoableEditListener(UndoableEditListener listener)
Registers an
UndoableEditListener that will be
called when a new edit is added to this undo manager. |
boolean |
isEnabled()
Returns
true if this undo manager is enabled, that is,
if it is currently recording changes in the SDM model. |
void |
redo()
Redoes the last undone edit.
|
void |
removeUndoableEditListener(UndoableEditListener listener)
Removes an
UndoableEditListener. |
void |
setEnabled(boolean enabled)
Enables or disables this undo manager.
|
void |
undo()
Undoes the last edit.
|
addEdit, canRedo, canUndo, canUndoOrRedo, discardAllEdits, editToBeRedone, editToBeUndone, end, getLimit, getRedoPresentationName, getUndoOrRedoPresentationName, getUndoPresentationName, redoTo, setLimit, toString, trimEdits, trimForLimit, undoableEditHappened, undoOrRedo, undoTodie, getPresentationName, isInProgress, isSignificant, lastEditreplaceEditpublic IlvSDMUndoManager(IlvSDMEngine engine)
engine - The SDM engine.public boolean isEnabled()
true if this undo manager is enabled, that is,
if it is currently recording changes in the SDM model.setEnabled(boolean)public void setEnabled(boolean enabled)
The undo manager is enabled by default.
enabled - If true, the undo manager records all changes in the
SDM model. Otherwise the changes are not recorded until the undo manager
is enabled again.public void undo()
undo in interface UndoableEditundo in class UndoManagerpublic void redo()
redo in interface UndoableEditredo in class UndoManagerpublic void addUndoableEditListener(UndoableEditListener listener)
UndoableEditListener that will be
called when a new edit is added to this undo manager.listener - The listener to add.public void removeUndoableEditListener(UndoableEditListener listener)
UndoableEditListener.listener - The listener to remove.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.