public interface ILcdUndoable extends ILcdPropertyChangeSource
This interface describes objects that implement undo and redo behavior. When actions want to
support a undo/redo mechanism, they should generate these kinds of objects and notify an ILcdUndoableListener
that an undoable event has happened. This listener can than for instance
provide actions to undo these events.
TLcdUndoManager
,
TLcdUndoAction
,
TLcdRedoAction
Modifier and Type | Method and Description |
---|---|
boolean |
addUndoable(ILcdUndoable aUndoable)
Adds aUndoable to this
ILcdUndoable . |
boolean |
canRedo()
Returns whether or not this
ILcdUndoable can be redone. |
boolean |
canUndo()
Returns whether or not this
ILcdUndoable can be undone. |
void |
die()
Method that might be invoked to allow for cleanup tasks.
|
String |
getDisplayName()
Returns the display name of this
ILcdUndoable . |
String |
getRedoDisplayName()
Returns the redo display name of this
ILcdUndoable . |
String |
getUndoDisplayName()
Returns the undo display name of this
ILcdUndoable . |
boolean |
isSignificant()
Returns false if this
ILcdUndoable is insignificant--for example one that
maintains the user's selection, but does not change any model state. |
void |
redo()
Redoes the operation represented by this
ILcdUndoable . |
void |
undo()
Undoes the operation represented by this
ILcdUndoable . |
addPropertyChangeListener, removePropertyChangeListener
void undo() throws TLcdCannotUndoRedoException
ILcdUndoable
.TLcdCannotUndoRedoException
void redo() throws TLcdCannotUndoRedoException
ILcdUndoable
.TLcdCannotUndoRedoException
boolean canUndo()
ILcdUndoable
can be undone.ILcdUndoable
can be undone.boolean canRedo()
ILcdUndoable
can be redone.ILcdUndoable
can be redone.String getDisplayName()
ILcdUndoable
. It can for example be used for
logging purposes.String getRedoDisplayName()
ILcdUndoable
. It can for example be used as
the text of a menu item.String getUndoDisplayName()
ILcdUndoable
. It can for example be used as
the text of a menu item.boolean isSignificant()
ILcdUndoable
is insignificant--for example one that
maintains the user's selection, but does not change any model state. This status can be used by
an ILcdUndoableListener
(like TLcdUndoManager) when deciding which
ILcdUndoable
s to present to the user as Undo/Redo options, and which to perform as
side effects of undoing or redoing other events.ILcdUndoable
is significant.void die()
boolean addUndoable(ILcdUndoable aUndoable)
Adds aUndoable to this ILcdUndoable
. If aUndoable
cannot be added,
this method should return false.
This mechanism allows you to collapse multiple ILcdUndoable
s into one. For
instance when typing, you may or may not want every single keystroke to be separately undoable, but
instead to undo a series of keystrokes that were within a certain time of each other.
aUndoable
- The undoable to add to this ILcdUndoable
.aUndoable
was accepted by this ILcdUndoable
.