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 匹配
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
HTMLEditorKit执行。
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
匹配
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.