Class AbstractDocument.DefaultDocumentEvent

java.lang.Object
javax.swing.undo.AbstractUndoableEdit
javax.swing.undo.CompoundEdit
javax.swing.text.AbstractDocument.DefaultDocumentEvent
All Implemented Interfaces:
Serializable, DocumentEvent, UndoableEdit
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.
  • Nested Class Summary

    Nested classes/interfaces declared in interface DocumentEvent

    DocumentEvent.ElementChange, DocumentEvent.EventType
    Modifier and Type
    Interface
    Description
    static interface 
    Describes changes made to a specific element.
    static final class 
    Enumeration for document event types
  • Field Summary

    Fields declared in class CompoundEdit

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

    Fields declared in class AbstractUndoableEdit

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

    Constructors
    Constructor
    Description
    DefaultDocumentEvent(int offs, int len, DocumentEvent.EventType type)
    Constructs a change record.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Adds a document edit.
    Gets the changes for an element.
    Gets the document that sourced the change event.
    int
    Returns the length of the change.
    int
    Returns the offset within the document of the start of the change.
    Provides a localized, human readable description of this edit suitable for use in, say, a change log.
    Provides a localized, human readable description of the redoable form of this edit, e.g. for use as a Redo menu item.
    Returns the type of event.
    Provides a localized, human readable description of the undoable form of this edit, e.g. for use as an Undo menu item.
    boolean
    DefaultDocument events are significant.
    void
    Redoes a change.
    Returns a string description of the change event.
    void
    Undoes a change.

    Methods declared in class CompoundEdit

    canRedo, canUndo, die, end, isInProgress, lastEdit
    Modifier and Type
    Method
    Description
    boolean
    Returns false if isInProgress or if super returns false.
    boolean
    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.
    boolean
    Returns true if this edit is in progress--that is, it has not received end.
    protected UndoableEdit
    Returns the last UndoableEdit in edits, or null if edits is empty.

    Methods declared in class AbstractUndoableEdit

    replaceEdit
    Modifier and Type
    Method
    Description
    boolean
    This default implementation returns false.

    Methods declared in class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    Modifier and Type
    Method
    Description
    protected Object
    Creates and returns a copy of this object.
    boolean
    Indicates whether some other object is "equal to" this one.
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Finalization is deprecated and subject to removal in a future release.
    final Class<?>
    Returns the runtime class of this Object.
    int
    Returns a hash code value for this object.
    final void
    Wakes up a single thread that is waiting on this object's monitor.
    final void
    Wakes up all threads that are waiting on this object's monitor.
    final void
    Causes the current thread to wait until it is awakened, typically by being notified or interrupted.
    final void
    wait(long timeoutMillis)
    Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
    final void
    wait(long timeoutMillis, int nanos)
    Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.