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
    Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.
    boolean
    Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
    May cause performance issues, deadlocks and hangs.
    final Class<? extends Object>
    Answers the unique instance of java.lang.Class which represents the class of the receiver.
    int
    Answers an integer hash code for the receiver.
    final void
    Causes one thread which is waiting on the receiver to be made ready to run.
    final void
    Causes all threads which are waiting on the receiver to be made ready to run.
    final void
    Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated by notify or notifyAll).
    final void
    wait(long time)
    Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated by notify or notifyAll) or the expiration of the timeout.
    final void
    wait(long time, int frac)
    Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated by notify or notifyAll) or the expiration of the timeout.