javax.swing.text.Document , DocumentListener
| Modifier and Type | Class and Description |
|---|---|
| public static interface | DocumentEvent.
Describes changes made to a specific element. |
| public static class | DocumentEvent.
Enumeration for document event types |
| Modifier and Type | Method and Description |
|---|---|
| public DocumentEvent. | |
| public Document | |
| public int | |
| public int | Returns: the offset >= 0Returns the offset within the document of the start of the change. |
| public DocumentEvent. |
| getChange | back to summary |
|---|---|
| public DocumentEvent. Gets the change information for the given element. The change information describes what elements were added and removed and the location. If there were no changes, null is returned. 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 mutation) need to have ElementChange records. The changes made available need not be recursive. For example, if an element is removed from its 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 a child element is inserted 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.
| |
| getDocument | back to summary |
|---|---|
| public Document getDocument() Gets the document that sourced the change event.
| |
| getLength | back to summary |
|---|---|
| public int getLength() Returns the length of the change.
| |
| getOffset | back to summary |
|---|---|
| public int getOffset() Returns the offset within the document of the start of the change.
| |
| getType | back to summary |
|---|---|
| public DocumentEvent. Gets the type of event.
| |
| Modifier and Type | Method and Description |
|---|---|
| public Element[] | Returns: the child elementsGets the child elements that were added to the given parent element. |
| public Element[] | Returns: the child elementsGets the child elements that were removed from the given parent element. |
| public Element | |
| public int |
| getChildrenAdded | back to summary |
|---|---|
| public Element[] getChildrenAdded() Gets the child elements that were added to the given parent element. The element array returned is in the order that the elements lie in the document, and must be contiguous.
| |
| getChildrenRemoved | back to summary |
|---|---|
| public Element[] getChildrenRemoved() Gets the child elements that were removed from the given parent element. The element array returned is sorted in the order that the elements used to lie in the document, and must be contiguous.
| |
| getElement | back to summary |
|---|---|
| public Element getElement() Returns the element represented. This is the element that was changed.
| |
| getIndex | back to summary |
|---|---|
| public int getIndex() Fetches the index within the element represented. This is the location that children were added and/or removed.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final DocumentEvent. | CHANGE
Change type. |
| public static final DocumentEvent. | INSERT
Insert type. |
| public static final DocumentEvent. | REMOVE
Remove type. |
| private String |
| Modifier and Type | Method and Description |
|---|---|
| public String |
| CHANGE | back to summary |
|---|---|
| public static final DocumentEvent. Change type. | |
| INSERT | back to summary |
|---|---|
| public static final DocumentEvent. Insert type. | |
| REMOVE | back to summary |
|---|---|
| public static final DocumentEvent. Remove type. | |
| typeString | back to summary |
|---|---|
| private String typeString | |
| EventType | back to summary |
|---|---|
| private EventType(String s) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Converts the type to a string.
| |