Package com.luciad.gui
Interface ILcdUndoable
- All Superinterfaces:
ILcdPropertyChangeSource
- All Known Implementing Classes:
ALcdUndoable
,TLcdCompositeUndoable
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.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addUndoable
(ILcdUndoable aUndoable) Adds aUndoable to thisILcdUndoable
.boolean
canRedo()
Returns whether or not thisILcdUndoable
can be redone.boolean
canUndo()
Returns whether or not thisILcdUndoable
can be undone.void
die()
Method that might be invoked to allow for cleanup tasks.Returns the display name of thisILcdUndoable
.Returns the redo display name of thisILcdUndoable
.Returns the undo display name of thisILcdUndoable
.boolean
Returns false if thisILcdUndoable
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 thisILcdUndoable
.void
undo()
Undoes the operation represented by thisILcdUndoable
.Methods inherited from interface com.luciad.util.ILcdPropertyChangeSource
addPropertyChangeListener, removePropertyChangeListener
-
Method Details
-
undo
Undoes the operation represented by thisILcdUndoable
.- Throws:
TLcdCannotUndoRedoException
-
redo
Redoes the operation represented by thisILcdUndoable
.- Throws:
TLcdCannotUndoRedoException
-
canUndo
boolean canUndo()Returns whether or not thisILcdUndoable
can be undone.- Returns:
- Whether or not this
ILcdUndoable
can be undone.
-
canRedo
boolean canRedo()Returns whether or not thisILcdUndoable
can be redone.- Returns:
- Whether or not this
ILcdUndoable
can be redone.
-
getDisplayName
String getDisplayName()Returns the display name of thisILcdUndoable
. It can for example be used for logging purposes. -
getRedoDisplayName
String getRedoDisplayName()Returns the redo display name of thisILcdUndoable
. It can for example be used as the text of a menu item.- Returns:
- The redo display name
-
getUndoDisplayName
String getUndoDisplayName()Returns the undo display name of thisILcdUndoable
. It can for example be used as the text of a menu item. -
isSignificant
boolean isSignificant()Returns false if thisILcdUndoable
is insignificant--for example one that maintains the user's selection, but does not change any model state. This status can be used by anILcdUndoableListener
(like TLcdUndoManager) when deciding whichILcdUndoable
s to present to the user as Undo/Redo options, and which to perform as side effects of undoing or redoing other events.- Returns:
- Whether or not this
ILcdUndoable
is significant.
-
die
void die()Method that might be invoked to allow for cleanup tasks. For instance I/O streams could be closed here. -
addUndoable
Adds aUndoable to this
ILcdUndoable
. IfaUndoable
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.- Parameters:
aUndoable
- The undoable to add to thisILcdUndoable
.- Returns:
- Whether or not
aUndoable
was accepted by thisILcdUndoable
.
-