GNU Classpath (0.95) | |
Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
javax.swing.undo.AbstractUndoableEdit
UndoableEdit
that can be
used as a base for implementing editing operations.
Field Summary | |
protected static String |
|
protected static String |
|
Constructor Summary | |
|
Method Summary | |
boolean |
|
boolean |
|
boolean |
|
void |
|
String |
|
String |
|
String |
|
boolean |
|
void |
|
boolean |
|
String |
|
void |
|
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
protected static final String RedoName
The constant string “Redo”, which was returned bygetRedoPresentationName()
on early versions of the platform. However, this field has become obsolete with version 1.3.1. That method now retrieves a localized string from theUIManager
, using the key“AbstractUndoableEdit.redoText”
.
- Field Value:
- "Redo"
protected static final String UndoName
The constant string “Undo”, which was returned bygetUndoPresentationName()
on early versions of the platform. However, this field has become obsolete with version 1.3.1. That method now retrieves a localized string from theUIManager
, using the key“AbstractUndoableEdit.undoText”
.
- Field Value:
- "Undo"
public AbstractUndoableEdit()
Constructs a newAbstractUndoableEdit
. The initial state is that the editing action is alive, andhasBeenDone
istrue
.
public boolean addEdit(UndoableEdit edit)
Incorporates another editing action into this one, thus forming a combined action.The default implementation always returns
false
, indicating that the editing action could not be incorporated.
- Specified by:
- addEdit in interface UndoableEdit
- Parameters:
edit
- the editing action to be incorporated.
public boolean canRedo()
Determines whether it would be possible to redo this editing action.
- Specified by:
- canRedo in interface UndoableEdit
- Returns:
true
to indicate that this action can be redone,false
otherwise.
public boolean canUndo()
Determines whether it would be possible to undo this editing action.
- Specified by:
- canUndo in interface UndoableEdit
- Returns:
true
to indicate that this action can be undone,false
otherwise.
public void die()
Informs this edit action that it will no longer be used. Some actions might use this information to release resources, for example open files. Called byUndoManager
before this action is removed from the edit queue.
- Specified by:
- die in interface UndoableEdit
public String getPresentationName()
Returns a human-readable, localized name that describes this editing action and can be displayed to the user.The default implementation returns an empty string.
- Specified by:
- getPresentationName in interface UndoableEdit
public String getRedoPresentationName()
Calculates a localized name for presenting the redo action to the user.The default implementation returns the concatenation of the string “Redo” and the action name, which is determined by calling
getPresentationName()
.The string “Redo” is retrieved from the
UIManager
, using the key“AbstractUndoableEdit.redoText”
. This allows the text to be localized.
- Specified by:
- getRedoPresentationName in interface UndoableEdit
public String getUndoPresentationName()
Calculates a localized name for presenting the undo action to the user.The default implementation returns the concatenation of the string “Undo” and the action name, which is determined by calling
getPresentationName()
.The string “Undo” is retrieved from the
UIManager
, using the key“AbstractUndoableEdit.undoText”
. This allows the text to be localized.
- Specified by:
- getUndoPresentationName in interface UndoableEdit
public boolean isSignificant()
Determines whether this editing action is significant enough for being seperately undoable by the user. A typical significant action would be the resizing of an object. However, changing the selection in a text document would usually not be considered significant.The default implementation returns
true
.
- Specified by:
- isSignificant in interface UndoableEdit
- Returns:
true
to indicate that the action is significant enough for being separately undoable, orfalse
otherwise.
public void redo() throws CannotRedoException
Redoes this editing action.
- Specified by:
- redo in interface UndoableEdit
- Throws:
CannotRedoException
- ifcanRedo()
returnsfalse
, for example because this action has not yet been undone.
public boolean replaceEdit(UndoableEdit edit)
Incorporates another editing action into this one, thus forming a combined action that replaces the argument action.The default implementation always returns
false
, indicating that the argument action should not be replaced.
- Specified by:
- replaceEdit in interface UndoableEdit
- Parameters:
edit
- the editing action to be replaced.
public void undo() throws CannotUndoException
Undoes this editing action.
- Specified by:
- undo in interface UndoableEdit
- Throws:
CannotUndoException
- ifcanUndo()
returnsfalse
, for example because this action has already been undone.
GNU Classpath (0.95) |