|
JSR-209 (Final Release) | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.undo.AbstractUndoableEdit
An abstract implementation of UndoableEdit
,
implementing simple responses to all boolean methods in
that interface.
Constructor Summary | |
protected |
AbstractUndoableEdit()
Creates an AbstractUndoableEdit which defaults
alive to true . |
Method Summary | |
boolean |
addEdit(UndoableEdit anEdit)
This default implementation returns false. |
boolean |
canRedo()
Returns true if this edit is alive
and hasBeenDone is false . |
boolean |
canUndo()
Returns true if this edit is alive
and hasBeenDone is true . |
void |
die()
Sets alive to false. |
java.lang.String |
getPresentationName()
This default implementation returns "". |
boolean |
isSignificant()
This default implementation returns true. |
void |
redo()
Throws CannotRedoException if canRedo
returns false. |
boolean |
replaceEdit(UndoableEdit anEdit)
This default implementation returns false. |
java.lang.String |
toString()
Returns a string that displays and identifies this object's properties. |
void |
undo()
Throws CannotUndoException if canUndo
returns false . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected AbstractUndoableEdit()
AbstractUndoableEdit
which defaults
alive
to true
.
Method Detail |
public void die()
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.
die
in interface UndoableEdit
CompoundEdit.die()
public void undo() throws CannotUndoException
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.
undo
in interface UndoableEdit
CannotUndoException
- if canUndo
returns false
canUndo()
public boolean canUndo()
alive
and hasBeenDone
is true
.
canUndo
in interface UndoableEdit
alive
and hasBeenDone
is true
die()
,
undo()
,
redo()
public void redo() throws CannotRedoException
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.
redo
in interface UndoableEdit
CannotRedoException
- if canRedo
returns false
canRedo()
public boolean canRedo()
true
if this edit is alive
and hasBeenDone
is false
.
canRedo
in interface UndoableEdit
true
if this edit is alive
and hasBeenDone
is false
die()
,
undo()
,
redo()
public boolean addEdit(UndoableEdit anEdit)
addEdit
in interface UndoableEdit
anEdit
- the edit to be added
UndoableEdit.addEdit(javax.swing.undo.UndoableEdit)
public boolean replaceEdit(UndoableEdit anEdit)
replaceEdit
in interface UndoableEdit
anEdit
- the edit to replace
UndoableEdit.replaceEdit(javax.swing.undo.UndoableEdit)
public boolean isSignificant()
isSignificant
in interface UndoableEdit
UndoableEdit.isSignificant()
public java.lang.String getPresentationName()
getPresentationName
in interface UndoableEdit
public java.lang.String toString()
|
JSR-209 (Final Release) | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |