| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public class CompoundEdit extends AbstractUndoableEdit
A concrete subclass of AbstractUndoableEdit, used to assemble little UndoableEdits into great big ones.
Field Summary | |
---|---|
protected Vector |
edits
The collection of UndoableEdit s
undone/redone en masse by this CompoundEdit . |
Fields inherited from class javax.swing.undo.AbstractUndoableEdit |
---|
RedoName, UndoName |
Constructor Summary | |
---|---|
|
Method Summary | |
---|---|
boolean |
addEdit(UndoableEdit anEdit) If this edit is inProgress ,
accepts anEdit and returns true.
|
boolean |
canRedo() Returns false if isInProgress or if super
returns false.
|
boolean |
canUndo() Returns false if isInProgress or if super
returns false.
|
void |
die() Sends die to each subedit,
in the reverse of the order that they were added.
|
void |
end() Sets inProgress to false.
|
String |
Returns getPresentationName from the
last UndoableEdit added to
edits .
|
String |
Returns getRedoPresentationName
from the last UndoableEdit
added to edits .
|
String |
Returns getUndoPresentationName
from the last UndoableEdit
added to edits .
|
boolean |
Returns true if this edit is in progress--that is, it has not received end. |
boolean |
Returns true if any of the UndoableEdit s
in edits do.
|
protected UndoableEdit |
lastEdit() Returns the last UndoableEdit in
edits , or null
if edits is empty.
|
void |
redo() Sends redo to all contained
UndoableEdit s in the order in
which they were added.
|
String |
toString() Returns a string that displays and identifies this object's properties. |
void |
undo() Sends undo to all contained
UndoableEdits in the reverse of
the order in which they were added.
|
Methods inherited from class javax.swing.undo.AbstractUndoableEdit |
---|
addEdit, canRedo, canUndo, die, getPresentationName, getRedoPresentationName, getUndoPresentationName, isSignificant, redo, replaceEdit, toString, undo |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Vector edits
UndoableEdit
s
undone/redone en masse by this CompoundEdit
.
Constructor Detail |
---|
public CompoundEdit()
Method Detail |
---|
public boolean addEdit(UndoableEdit anEdit)
inProgress
,
accepts anEdit
and returns true.
The last edit added to this CompoundEdit
is given a chance to addEdit(anEdit)
.
If it refuses (returns false), anEdit
is
given a chance to replaceEdit
the last edit.
If anEdit
returns false here,
it is added to edits
.
addEdit
in class AbstractUndoableEdit
anEdit
- the edit to be addedinProgress
;
otherwise returns falsepublic boolean canRedo()
isInProgress
or if super
returns false.
canRedo
in class AbstractUndoableEdit
public boolean canUndo()
isInProgress
or if super
returns false.
canUndo
in class AbstractUndoableEdit
public void die()
die
to each subedit,
in the reverse of the order that they were added.
die
in class AbstractUndoableEdit
public void end()
inProgress
to false.
public String getPresentationName()
getPresentationName
from the
last UndoableEdit
added to
edits
. If edits
is empty,
calls super.
getPresentationName
in class AbstractUndoableEdit
public String getRedoPresentationName()
getRedoPresentationName
from the last UndoableEdit
added to edits
.
If edits
is empty, calls super.
getRedoPresentationName
in class AbstractUndoableEdit
public String getUndoPresentationName()
getUndoPresentationName
from the last UndoableEdit
added to edits
.
If edits
is empty, calls super.
getUndoPresentationName
in class AbstractUndoableEdit
public boolean isInProgress()
public boolean isSignificant()
UndoableEdit
s
in edits
do.
Returns false if they all return false.
isSignificant
in class AbstractUndoableEdit
protected UndoableEdit lastEdit()
UndoableEdit
in
edits
, or null
if edits
is empty.
public void redo() throws CannotRedoException
redo
to all contained
UndoableEdit
s in the order in
which they were added.
redo
in class AbstractUndoableEdit
CannotRedoException
public String toString()
toString
in class AbstractUndoableEdit
public void undo() throws CannotUndoException
undo
to all contained
UndoableEdits
in the reverse of
the order in which they were added.
undo
in class AbstractUndoableEdit
CannotUndoException
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |