AbstractUndoableEdit (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.ElementEdit](../text/AbstractDocument.ElementEdit.html "class in javax.swing.text"), [CompoundEdit](CompoundEdit.html "class in javax.swing.undo"), [DefaultStyledDocument.AttributeUndoableEdit](../text/DefaultStyledDocument.AttributeUndoableEdit.html "class in javax.swing.text"), [StateEdit](StateEdit.html "class in javax.swing.undo")


public class AbstractUndoableEdit extends Object implements UndoableEdit, Serializable

An abstract implementation of UndoableEdit, implementing simple responses to all boolean methods in that interface.

Fields

Modifier and Type Field Description
protected static String RedoName String returned by getRedoPresentationName; as of Java 2 platform v1.3.1 this field is no longer used.
protected static String UndoName String returned by getUndoPresentationName; as of Java 2 platform v1.3.1 this field is no longer used.

Constructors

Constructor Description
AbstractUndoableEdit() Creates an AbstractUndoableEdit which defaultshasBeenDone and alive to true.
Modifier and Type Method Description
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.
String getPresentationName() This default implementation returns "".
String getRedoPresentationName() Retreives the value from the defaults table with keyAbstractUndoableEdit.redoText and returns that value followed by a space, followed bygetPresentationName.
String getUndoPresentationName() Retreives the value from the defaults table with keyAbstractUndoableEdit.undoText and returns that value followed by a space, followed bygetPresentationName.
boolean isSignificant() This default implementation returns true.
void redo() Throws CannotRedoException if canRedo returns false.
boolean replaceEdit​(UndoableEdit anEdit) This default implementation returns false.
String toString() Returns a string that displays and identifies this object's properties.
void undo() Throws CannotUndoException if canUndo returns false.