public class IlvOrderedCompoundEdit extends CompoundEdit
java.swing.undo.CompoundEdit
performs the undo in reverse order.
Furthermore it adds edits without absorbing subedits,
see addEditNoAbsorb(javax.swing.undo.UndoableEdit)
.edits
RedoName, UndoName
Constructor and Description |
---|
IlvOrderedCompoundEdit(String name)
Creates a new edit.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addEdit(UndoableEdit anEdit)
If this edit is
inProgress ,
accepts anEdit and returns true. |
boolean |
addEditNoAbsorb(UndoableEdit anEdit)
Adds an edit without absorbing subedits.
|
void |
end()
Sets
inProgress to false. |
UndoableEdit |
getEdit(int index)
Returns the subedit at given index.
|
UndoableEdit |
getEdit(String presentationName)
Returns the subedit with a given presentation name.
|
String |
getPresentationName()
Returns the presentation name of the edit.
|
boolean |
isInProgress()
Returns true if this edit is in progress, that is, it has not
received end.
|
int |
size()
Returns the number of subedits.
|
void |
start()
Sets
inProgress to true. |
void |
undo()
Sends
undo to all contained
UndoableEdits in the the same order
in which they were added. |
canRedo, canUndo, die, getRedoPresentationName, getUndoPresentationName, isSignificant, lastEdit, redo, toString
replaceEdit
public IlvOrderedCompoundEdit(String name)
name
- The presentation name of the editpublic void undo() throws CannotUndoException
undo
to all contained
UndoableEdits
in the the same order
in which they were added.undo
in interface UndoableEdit
undo
in class CompoundEdit
CannotUndoException
- if the edit is in progress or if
any of the subedits cannot be undone.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 interface UndoableEdit
addEdit
in class CompoundEdit
anEdit
- the edit to be addedinProgress
;
otherwise returns falsepublic boolean addEditNoAbsorb(UndoableEdit anEdit)
public void start()
inProgress
to true.
This means that edits can be added to it.CompoundEdit.canUndo()
,
CompoundEdit.canRedo()
public void end()
inProgress
to false.
This means that edits cannot anymore be added to it.end
in class CompoundEdit
CompoundEdit.canUndo()
,
CompoundEdit.canRedo()
public boolean isInProgress()
isInProgress
in class CompoundEdit
start()
,
end()
public int size()
public UndoableEdit getEdit(int index)
public UndoableEdit getEdit(String presentationName)
public String getPresentationName()
getPresentationName
in interface UndoableEdit
getPresentationName
in class CompoundEdit
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.