public class DefaultDocumentEvent
extends java.util.EventObject
implements javax.swing.event.DocumentEvent
| Constructor and Description |
|---|
DefaultDocumentEvent(javax.swing.text.Document src,
int offs,
int len,
javax.swing.event.DocumentEvent.EventType type)
Creates a new DefaultDocumentEvent.
|
| Modifier and Type | Method and Description |
|---|---|
javax.swing.event.DocumentEvent.ElementChange |
getChange(javax.swing.text.Element elem)
Gets the change information for the given element.
|
javax.swing.text.Document |
getDocument()
Gets the document that sourced the change event.
|
int |
getLength()
Returns the length of the change.
|
int |
getOffset()
Returns the offset within the document of the start
of the change.
|
javax.swing.event.DocumentEvent.EventType |
getType()
Gets the type of event.
|
public DefaultDocumentEvent(javax.swing.text.Document src,
int offs,
int len,
javax.swing.event.DocumentEvent.EventType type)
src - The Source of the event.offs - the offset into the document of the change >= 0len - the length of the change >= 0type - the type of the event DocumentEvent.EventType;public javax.swing.event.DocumentEvent.ElementChange getChange(javax.swing.text.Element elem)
This method is for observers to discover the structural changes that were made. This means that only elements that existed prior to the mutation (and still exist after the mutatino) need to have ElementChange records. The changes made available need not be recursive.
For example, if the an element is removed from it's parent, this method should report that the parent changed and provide an ElementChange implementation that describes the change to the parent. If the child element removed had children, these elements do not need to be reported as removed.
If an child element is insert into a parent element, the parent element should report a change. If the child element also had elements inserted into it (grandchildren to the parent) these elements need not report change.
getChange in interface javax.swing.event.DocumentEventelem - the elementpublic javax.swing.text.Document getDocument()
getDocument in interface javax.swing.event.DocumentEventpublic int getLength()
getLength in interface javax.swing.event.DocumentEventpublic javax.swing.event.DocumentEvent.EventType getType()
getType in interface javax.swing.event.DocumentEventpublic int getOffset()
getOffset in interface javax.swing.event.DocumentEvent