CompoundEdit (Java SE 15 & JDK 15) (original) (raw)

All Implemented Interfaces:

[Serializable](../../../../java.base/java/io/Serializable.html "interface in java.io"), [UndoableEdit](UndoableEdit.html "interface in javax.swing.undo")

Direct Known Subclasses:

[AbstractDocument.DefaultDocumentEvent](../text/AbstractDocument.DefaultDocumentEvent.html "class in javax.swing.text"), [UndoManager](UndoManager.html "class in javax.swing.undo")


public class CompoundEdit extends AbstractUndoableEdit

A concrete subclass of AbstractUndoableEdit, used to assemble little UndoableEdits into great big ones.

Fields

Modifier and Type Field Description
protected Vector<UndoableEdit> edits The collection of UndoableEdits undone/redone en masse by this CompoundEdit.

Constructors

Constructor Description
CompoundEdit() Constructs a CompoundEdit.
Modifier and Type Method Description
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 getPresentationName() Returns getPresentationName from the last UndoableEdit added toedits.
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.
protected UndoableEdit lastEdit() Returns the last UndoableEdit inedits, or null if edits is empty.
void redo() Sends redo to all containedUndoableEdits 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 containedUndoableEdits in the reverse of the order in which they were added.