public abstract static class HTMLEditorKit.HTMLTextAction extends StyledEditorKit.StyledTextAction
注意:没有方便的方法获取文档上的锁定。 如果您有另一个线程修改文本,这些方法可能会有不一致的行为,或返回错误的东西。
changeSupport, enabled
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
Constructor and Description |
---|
HTMLTextAction(String name) |
Modifier and Type | Method and Description |
---|---|
protected int |
elementCountToTag(HTMLDocument doc, int offset, HTML.Tag tag)
返回元素数,从最深的叶开始,需要到达一个代表
tag 的元素。
|
protected Element |
findElementMatchingTag(HTMLDocument doc, int offset, HTML.Tag tag)
返回
offset 元素
offset 匹配
tag 。
|
protected Element[] |
getElementsAt(HTMLDocument doc, int offset)
返回一个包含
offset 的元素的数组。
|
protected HTMLDocument |
getHTMLDocument(JEditorPane e) |
protected HTMLEditorKit |
getHTMLEditorKit(JEditorPane e) |
getEditor, getStyledDocument, getStyledEditorKit, setCharacterAttributes, setParagraphAttributes
augmentList, getFocusedComponent, getTextComponent
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
actionPerformed
public HTMLTextAction(String name)
protected HTMLDocument getHTMLDocument(JEditorPane e)
e
。
protected HTMLEditorKit getHTMLEditorKit(JEditorPane e)
e
。
protected Element[] getElementsAt(HTMLDocument doc, int offset)
offset
的元素的数组。
第一个元素对应于根。
protected int elementCountToTag(HTMLDocument doc, int offset, HTML.Tag tag)
tag
的元素。
这将返回-1,如果没有找到元素表示tag
,或0,如果叶的在父offset
表示tag
。
protected Element findElementMatchingTag(HTMLDocument doc, int offset, HTML.Tag tag)
offset
元素
offset
匹配
tag
。
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.