AbstractDocument.DefaultDocumentEvent
public interface DocumentEvent
Document
,
DocumentListener
Modifier and Type | Interface | Description |
---|---|---|
static interface |
DocumentEvent.ElementChange |
Describes changes made to a specific element.
|
static class |
DocumentEvent.EventType |
Enumeration for document event types
|
Modifier and Type | Method | Description |
---|---|---|
DocumentEvent.ElementChange |
getChange(Element elem) |
Gets the change information for the given element.
|
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.
|
DocumentEvent.EventType |
getType() |
Gets the type of event.
|
int getOffset()
int getLength()
Document getDocument()
DocumentEvent.EventType getType()
DocumentEvent.ElementChange getChange(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 mutation) 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.
elem
- the element Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2017, Oracle and/or its affiliates. 500 Oracle Parkway
Redwood Shores, CA 94065 USA. All rights reserved.
DRAFT 9-internal+0-adhoc.mlchung.jdk9-jdeps