Methods Summary |
---|
public boolean | addEdit(javax.swing.undo.UndoableEdit anEdit)This default implementation returns false.
return false;
|
public boolean | canRedo()Returns true if this edit is alive
and hasBeenDone is false .
return alive && !hasBeenDone;
|
public boolean | canUndo()Returns true if this edit is alive
and hasBeenDone is true .
return alive && hasBeenDone;
|
public void | die()Sets alive to false. Note that this
is a one way operation; dead edits cannot be resurrected.
Sending undo or redo to
a dead edit results in an exception being thrown.
Typically an edit is killed when it is consolidated by
another edit's addEdit or replaceEdit
method, or when it is dequeued from an UndoManager .
alive = false;
|
public java.lang.String | getPresentationName()This default implementation returns "". Used by
getUndoPresentationName and
getRedoPresentationName to
construct the strings they return. Subclasses should override to
return an appropriate description of the operation this edit
represents.
return "";
|
public java.lang.String | getRedoPresentationName()Retreives the value from the defaults table with key
AbstractUndoableEdit.redoText and returns
that value followed by a space, followed by
getPresentationName .
If getPresentationName returns "",
then the defaults value is returned alone.
String name = getPresentationName();
if (!"".equals(name)) {
name = UIManager.getString("AbstractUndoableEdit.redoText") +
" " + name;
} else {
name = UIManager.getString("AbstractUndoableEdit.redoText");
}
return name;
|
public java.lang.String | getUndoPresentationName()Retreives the value from the defaults table with key
AbstractUndoableEdit.undoText and returns
that value followed by a space, followed by
getPresentationName .
If getPresentationName returns "",
then the defaults value is returned alone.
String name = getPresentationName();
if (!"".equals(name)) {
name = UIManager.getString("AbstractUndoableEdit.undoText") +
" " + name;
} else {
name = UIManager.getString("AbstractUndoableEdit.undoText");
}
return name;
|
public boolean | isSignificant()This default implementation returns true.
return true;
|
public void | redo()Throws CannotRedoException if canRedo
returns false. Sets hasBeenDone to true .
Subclasses should override to redo the operation represented by
this edit. Override should begin with a call to super.
if (!canRedo()) {
throw new CannotRedoException();
}
hasBeenDone = true;
|
public boolean | replaceEdit(javax.swing.undo.UndoableEdit anEdit)This default implementation returns false.
return false;
|
public java.lang.String | toString()Returns a string that displays and identifies this
object's properties.
return super.toString()
+ " hasBeenDone: " + hasBeenDone
+ " alive: " + alive;
|
public void | undo()Throws CannotUndoException if canUndo
returns false . Sets hasBeenDone
to false . Subclasses should override to undo the
operation represented by this edit. Override should begin with
a call to super.
if (!canUndo()) {
throw new CannotUndoException();
}
hasBeenDone = false;
|