AbstractDocument.DefaultDocumentEvent (Java SE 15 & JDK 15) (original) (raw)

All Implemented Interfaces:

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

Enclosing class:

AbstractDocument


public class AbstractDocument.DefaultDocumentEvent extends CompoundEdit implements DocumentEvent

Stores document changes as the document is being modified. Can subsequently be used for change notification when done with the document modification transaction. This is used by the AbstractDocument class and its extensions for broadcasting change information to the document listeners.

Modifier and Type Method Description
boolean addEdit​(UndoableEdit anEdit) Adds a document edit.
DocumentEvent.ElementChange getChange​(Element elem) Gets the changes for an element.
Document getDocument() Gets the document that sourced the change event.
int getLength() Returns the length of the change.
int getOffset() Returns the offset within the document of the start of the change.
String getPresentationName() Provides a localized, human readable description of this edit suitable for use in, say, a change log.
String getRedoPresentationName() Provides a localized, human readable description of the redoable form of this edit, e.g. for use as a Redo menu item.
DocumentEvent.EventType getType() Returns the type of event.
String getUndoPresentationName() Provides a localized, human readable description of the undoable form of this edit, e.g. for use as an Undo menu item.
boolean isSignificant() DefaultDocument events are significant.
void redo() Redoes a change.
String toString() Returns a string description of the change event.
void undo() Undoes a change.