All Packages Class Hierarchy This Package Previous Next Index
Class java.awt.swing.text.DefaultDocumentEvent
java.lang.Object
|
+----java.awt.swing.undo.AbstractUndoableEdit
|
+----java.awt.swing.undo.CompoundEdit
|
+----java.awt.swing.text.DefaultDocumentEvent
- public class 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.
- See Also:
- DocumentEvent, Document
DefaultDocumentEvent.ElementEdit- An implementation of ElementChange that can be added to the document
event.
DefaultDocumentEvent(Document, int, int)
- Constructs a change record.
addEdit(UndoableEdit)
- Adds a document edit.
getChange(Element)
- Gets the changes for an element.
getDocument()
- Gets the document that sourced the change event.
getEdit()
- Gets the current edit to the model.
getLength()
- Returns the length of the change.
getOffset()
- Returns the offset within the document of the start of the change.
toString()
- Returns a string description of the event.
DefaultDocumentEvent
public DefaultDocumentEvent(Document doc,
int offs,
int len)
- Constructs a change record.
- Parameters:
- doc - document that is being changed
- offs - the offset into the document of the change
- len - the length of the change
toString
public String toString()
- Returns a string description of the event.
- Returns:
- a string
- Overrides:
- toString in class CompoundEdit
addEdit
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.
- Parameters:
- anEdit - a document edit record
- Returns:
- ???
- Overrides:
- addEdit in class CompoundEdit
getEdit
public UndoableEdit getEdit()
- Gets the current edit to the model.
- Returns:
- the current edit
- See Also:
- getEdit
getOffset
public int getOffset()
- Returns the offset within the document of the start of the change.
- Returns:
- the offset
- See Also:
- getOffset
getLength
public int getLength()
- Returns the length of the change.
- Returns:
- the length
- See Also:
- getLength
getDocument
public Document getDocument()
- Gets the document that sourced the change event.
- Returns:
- the document
- See Also:
- getDocument
getChange
public DocumentEvent.ElementChange getChange(Element elem)
- Gets the changes for an element.
- Parameters:
- elem - the element
- Returns:
- the changes
All Packages Class Hierarchy This Package Previous Next Index
Submit a bug or feature