public class AbstractDocument.DefaultDocumentEvent extends javax.swing.undo.CompoundEdit implements javax.swing.event.DocumentEvent
Document is beeing modified.| Constructor and Description |
|---|
AbstractDocument.DefaultDocumentEvent(int offset,
int length,
javax.swing.event.DocumentEvent.EventType type)
Creates a new
DefaultDocumentEvent. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addEdit(javax.swing.undo.UndoableEdit edit)
Adds an UndoableEdit to this
DocumentEvent. |
javax.swing.event.DocumentEvent.ElementChange |
getChange(Element elem)
Returns the changes for an element.
|
Document |
getDocument()
Returns the document that has been modified.
|
int |
getLength()
Returns the length of the modification.
|
int |
getOffset()
Returns the start offset of the modification.
|
javax.swing.event.DocumentEvent.EventType |
getType()
Returns the type of the modification.
|
java.lang.String |
toString()
Returns a String description of the change event.
|
public AbstractDocument.DefaultDocumentEvent(int offset, int length, javax.swing.event.DocumentEvent.EventType type)
DefaultDocumentEvent.offset - the starting offset of the changelength - the length of the changetype - the type of changepublic boolean addEdit(javax.swing.undo.UndoableEdit edit)
DocumentEvent. If this
edit is an instance of AbstractDocument.ElementEdit, then this record can
later be fetched by calling getChange(javax.swing.text.Element).addEdit in interface javax.swing.undo.UndoableEditaddEdit in class javax.swing.undo.CompoundEditedit - the undoable edit to addtrue if edit could somehow be
incorporated; false if edit has not
been incorporated because CompoundEdit.end() was called before.public Document getDocument()
getDocument in interface javax.swing.event.DocumentEventpublic int getLength()
getLength in interface javax.swing.event.DocumentEventpublic int getOffset()
getOffset in interface javax.swing.event.DocumentEventpublic javax.swing.event.DocumentEvent.EventType getType()
getType in interface javax.swing.event.DocumentEventpublic javax.swing.event.DocumentEvent.ElementChange getChange(Element elem)
getChange in interface javax.swing.event.DocumentEventelem - the element for which the changes are requestedelem or null if
elem has not been changedpublic java.lang.String toString()
toString in class javax.swing.undo.CompoundEditObject.getClass(),
Object.hashCode(),
Class.getName(),
Integer.toHexString(int)