public class AbstractDocument.DefaultDocumentEvent extends CompoundEdit implements DocumentEvent
Document is beeing modified.DocumentEvent.ElementChange, DocumentEvent.EventTypeeditsRedoName, UndoName| Constructor and Description |
|---|
AbstractDocument.DefaultDocumentEvent(int offset,
int length,
DocumentEvent.EventType type)
Creates a new
DefaultDocumentEvent. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addEdit(UndoableEdit edit)
Adds an UndoableEdit to this
DocumentEvent. |
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.
|
DocumentEvent.EventType |
getType()
Returns the type of the modification.
|
String |
toString()
Returns a String description of the change event.
|
canRedo, canUndo, die, end, getPresentationName, getRedoPresentationName, getUndoPresentationName, isInProgress, isSignificant, lastEdit, redo, undoreplaceEditpublic AbstractDocument.DefaultDocumentEvent(int offset, int length, DocumentEvent.EventType type)
DefaultDocumentEvent.offset - the starting offset of the changelength - the length of the changetype - the type of changepublic boolean addEdit(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 UndoableEditaddEdit in class 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 DocumentEventpublic int getLength()
getLength in interface DocumentEventpublic int getOffset()
getOffset in interface DocumentEventpublic DocumentEvent.EventType getType()
getType in interface DocumentEventpublic DocumentEvent.ElementChange getChange(Element elem)
getChange in interface DocumentEventelem - the element for which the changes are requestedelem or null if
elem has not been changedpublic String toString()
toString in class CompoundEditObject.getClass(),
Object.hashCode(),
Class.getName(),
Integer.toHexString(int)