javax.swing.undo
public class AbstractUndoableEdit extends Object implements UndoableEdit, Serializable
UndoableEdit
that can be
used as a base for implementing editing operations.
Field Summary | |
---|---|
protected static String | RedoName
The constant string “Redo”, which was returned by
{@link #getRedoPresentationName()} on early versions of the
platform. |
protected static String | UndoName
The constant string “Undo”, which was returned by
{@link #getUndoPresentationName()} on early versions of the
platform. |
Constructor Summary | |
---|---|
AbstractUndoableEdit()
Constructs a new AbstractUndoableEdit . |
Method Summary | |
---|---|
boolean | addEdit(UndoableEdit edit)
Incorporates another editing action into this one, thus forming a
combined action.
|
boolean | canRedo()
Determines whether it would be possible to redo this editing
action.
|
boolean | canUndo()
Determines whether it would be possible to undo this editing
action.
|
void | die()
Informs this edit action that it will no longer be used. |
String | getPresentationName()
Returns a human-readable, localized name that describes this
editing action and can be displayed to the user.
|
String | getRedoPresentationName()
Calculates a localized name for presenting the redo action to the
user.
|
String | getUndoPresentationName()
Calculates a localized name for presenting the undo action to the
user.
|
boolean | isSignificant()
Determines whether this editing action is significant enough for
being seperately undoable by the user. |
void | redo()
Redoes this editing action.
|
boolean | replaceEdit(UndoableEdit edit)
Incorporates another editing action into this one, thus forming a
combined action that replaces the argument action.
|
String | toString() |
void | undo()
Undoes this editing action.
|
“AbstractUndoableEdit.redoText”
.“AbstractUndoableEdit.undoText”
.AbstractUndoableEdit
. The initial
state is that the editing action is alive, and
hasBeenDone
is true
.The default implementation always returns false
,
indicating that the editing action could not be incorporated.
Parameters: edit the editing action to be incorporated.
Returns: true
to indicate that this action can be
redone, false
otherwise.
Returns: true
to indicate that this action can be
undone, false
otherwise.
The default implementation returns an empty string.
The default implementation returns the concatenation of the string “Redo” and the action name, which is determined by calling {@link #getPresentationName()}.
The string “Redo” is retrieved from the {@link
javax.swing.UIManager}, using the key
“AbstractUndoableEdit.redoText”
. This
allows the text to be localized.
The default implementation returns the concatenation of the string “Undo” and the action name, which is determined by calling {@link #getPresentationName()}.
The string “Undo” is retrieved from the {@link
javax.swing.UIManager}, using the key
“AbstractUndoableEdit.undoText”
. This
allows the text to be localized.
The default implementation returns true
.
Returns: true
to indicate that the action is
significant enough for being separately undoable, or
false
otherwise.
Throws: CannotRedoException if {@link #canRedo()} returns
false
, for example because this action has not
yet been undone.
The default implementation always returns false
,
indicating that the argument action should not be replaced.
Parameters: edit the editing action to be replaced.