public interface DocumentEvent
Document
,
DocumentListener
Modifier and Type | Interface and Description |
---|---|
static interface |
DocumentEvent.ElementChange
描述对特定元素所做的更改。
|
static class |
DocumentEvent.EventType
文档事件类型的枚举
|
Modifier and Type | Method and Description |
---|---|
DocumentEvent.ElementChange |
getChange(Element elem)
获取给定元素的更改信息。
|
Document |
getDocument()
获取源更改事件的文档。
|
int |
getLength()
返回更改的长度。
|
int |
getOffset()
返回更改的开始文档中的偏移量。
|
DocumentEvent.EventType |
getType()
获取事件的类型。
|
int getOffset()
int getLength()
Document getDocument()
DocumentEvent.EventType getType()
DocumentEvent.ElementChange getChange(Element elem)
这种方法是观察者发现的结构变化。这意味着,只有元素的突变之前存在的(和后仍然存在突变)需要有elementchange记录。提供的变化不需要递归。
例如,如果一个元素是从它的母体取出,这种方法应该说家长改变提供了父母的改变elementchange实施。如果子元素删除了有孩子,这些元素不需要被报告为删除。
如果子元素插入到父元素中,父元素应该报告一个变化。如果子元素也有插入到它(孙子给父)的元素,这些元素不需要报告的变化。
elem
-元素
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, 2014, Oracle and/or its affiliates. All rights reserved.