Home » openjdk-7 » javax » swing » text » [javadoc | source]
public class: AbstractDocument.DefaultDocumentEvent [javadoc | source]

All Implemented Interfaces:
    DocumentEvent, UndoableEdit, Serializable

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.
Fields inherited from javax.swing.undo.CompoundEdit:
inProgress,  edits
Fields inherited from javax.swing.undo.AbstractUndoableEdit:
UndoName,  RedoName,  hasBeenDone,  alive
 public DefaultDocumentEvent(int offs,
    int len,
    EventType type) 
    Constructs a change record.
    offs - the offset into the document of the change >= 0
    len - the length of the change >= 0
    type - the type of event (DocumentEvent.EventType)
    since: 1.4 -
Method from javax.swing.text.AbstractDocument$DefaultDocumentEvent Summary:
addEdit,   getChange,   getDocument,   getLength,   getOffset,   getPresentationName,   getRedoPresentationName,   getType,   getUndoPresentationName,   isSignificant,   redo,   toString,   undo
Methods from javax.swing.undo.CompoundEdit:
addEdit,   canRedo,   canUndo,   die,   end,   getPresentationName,   getRedoPresentationName,   getUndoPresentationName,   isInProgress,   isSignificant,   lastEdit,   redo,   toString,   undo
Methods from javax.swing.undo.AbstractUndoableEdit:
addEdit,   canRedo,   canUndo,   die,   getPresentationName,   getRedoPresentationName,   getUndoPresentationName,   isSignificant,   redo,   replaceEdit,   toString,   undo
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.text.AbstractDocument$DefaultDocumentEvent Detail:
 public boolean addEdit(UndoableEdit anEdit) 
    Adds a document edit. If the number of edits crosses a threshold, this switches on a hashtable lookup for ElementChange implementations since access of these needs to be relatively quick.
 public ElementChange getChange(Element elem) 
    Gets the changes for an element.
 public Document getDocument() 
    Gets the document that sourced the change event.
 public int getLength() 
    Returns the length of the change.
 public int getOffset() 
    Returns the offset within the document of the start of the change.
 public String getPresentationName() 
    Provides a localized, human readable description of this edit suitable for use in, say, a change log.
 public String getRedoPresentationName() 
    Provides a localized, human readable description of the redoable form of this edit, e.g. for use as a Redo menu item. Typically derived from getPresentationName();
 public EventType getType() 
    Returns the type of event.
 public String getUndoPresentationName() 
    Provides a localized, human readable description of the undoable form of this edit, e.g. for use as an Undo menu item. Typically derived from getDescription();
 public boolean isSignificant() 
    DefaultDocument events are significant. If you wish to aggregate DefaultDocumentEvents to present them as a single edit to the user place them into a CompoundEdit.
 public  void redo() throws CannotRedoException 
    Redoes a change.
 public String toString() 
    Returns a string description of the change event.
 public  void undo() throws CannotUndoException 
    Undoes a change.