Class java.awt.swing.undo.CompoundEdit
java.lang.Object
|
+----java.awt.swing.undo.AbstractUndoableEdit
|
+----java.awt.swing.undo.CompoundEdit
- Subclasses:
- AbstractDocument.DefaultDocumentEvent, UndoManager
- public class CompoundEdit
- extends AbstractUndoableEdit
A concrete subclass of AbstractUndoableEdit, used to assemble little
UndoableEdits into great big ones.
Field Summary
|
Vector
|
edits
The collection of UndoableEdits undone/redone en masse by this
CompoundEdit
|
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 does.
|
boolean
|
canUndo()
Returns false if isInProgress or if super does.
|
void
|
die()
Send die to each subedit, in the reverse of the order that they
were added
|
void
|
end()
Sets inProgress to false.
|
String
|
getPresentationName()
Returns getPresentationName from the last UndoableEdit added to
edits.
|
String
|
getRedoPresentationName()
Returns getRedoPresentationName from the last UndoableEdit
added to edits.
|
String
|
getUndoPresentationName()
Returns getUndoPresentationName from the last UndoableEdit
added to edits.
|
boolean
|
isInProgress()
Returns true if this edit is in progress--that is, it has not
received end.
|
boolean
|
isSignificant()
Returns true if any of the UndoableEdits in edits do.
|
UndoableEdit
|
lastEdit()
Returns the last UndoableEdit in edits, or null if edits is
empty
|
void
|
redo()
Sends redo() to all contained UndoableEdits in the order in
which they were added.
|
String
|
toString()
|
void
|
undo()
Sends undo() to all contained UndoableEdits in the reverse of
the order in which they were added.
|
Methods inherited from class java.awt.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 |
edits
protected Vector edits
- The collection of UndoableEdits undone/redone en masse by this
CompoundEdit
CompoundEdit
public CompoundEdit()
undo
public void undo() throws CannotUndoException
- Sends undo() to all contained UndoableEdits in the reverse of
the order in which they were added.
- Overrides:
- undo in class AbstractUndoableEdit
redo
public void redo() throws CannotRedoException
- Sends redo() to all contained UndoableEdits in the order in
which they were added.
- Overrides:
- redo in class AbstractUndoableEdit
lastEdit
protected UndoableEdit lastEdit()
- Returns the last UndoableEdit in edits, or null if edits is
empty
die
public void die()
- Send die to each subedit, in the reverse of the order that they
were added
- Overrides:
- die in class AbstractUndoableEdit
addEdit
public boolean addEdit(UndoableEdit anEdit)
- If this edit is 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.
- Overrides:
- addEdit in class AbstractUndoableEdit
end
public void end()
- Sets inProgress to false.
- See Also:
- canUndo, canRedo
canUndo
public boolean canUndo()
- Returns false if isInProgress or if super does.
- Overrides:
- canUndo in class AbstractUndoableEdit
- See Also:
- isInProgress
canRedo
public boolean canRedo()
- Returns false if isInProgress or if super does.
- Overrides:
- canRedo in class AbstractUndoableEdit
- See Also:
- isInProgress
isInProgress
public boolean isInProgress()
- Returns true if this edit is in progress--that is, it has not
received end. This generally means that edits are still being
added to it.
- See Also:
- end
isSignificant
public boolean isSignificant()
- Returns true if any of the UndoableEdits in edits do. Returns
false if they all return false.
- Overrides:
- isSignificant in class AbstractUndoableEdit
getPresentationName
public String getPresentationName()
- Returns getPresentationName from the last UndoableEdit added to
edits. If edits is empty, calls super.
- Overrides:
- getPresentationName in class AbstractUndoableEdit
getUndoPresentationName
public String getUndoPresentationName()
- Returns getUndoPresentationName from the last UndoableEdit
added to edits. If edits is empty, calls super.
- Overrides:
- getUndoPresentationName in class AbstractUndoableEdit
getRedoPresentationName
public String getRedoPresentationName()
- Returns getRedoPresentationName from the last UndoableEdit
added to edits. If edits is empty, calls super.
- Overrides:
- getRedoPresentationName in class AbstractUndoableEdit
toString
public String toString()
- Overrides:
- toString in class AbstractUndoableEdit
Submit a bug or feature
Submit comments/suggestions about new javadoc look.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.