public static class HTMLEditorKit.InsertHTMLTextAction extends HTMLEditorKit.HTMLTextAction
例如,让我们说你想创建一个动作来将表插入到正文中。 parentTag将为HTML.Tag.BODY,addTag将为HTML.Tag.TABLE,字符串可能类似于<table> <tr> <td> </ td> </ tr> </ table>。
还可以提供备用parentTag和addTag的选项。 这些将被检查是否没有parentTag在偏移。
Modifier and Type | Field and Description |
---|---|
protected HTML.Tag |
addTag
HTML中的标签开始添加标签。
|
protected HTML.Tag |
alternateAddTag
HTML中的替代标签开始添加标签,如果没有找到parentTag,并找到alternateParentTag。
|
protected HTML.Tag |
alternateParentTag
如果没有找到parentTag,则在文档中检查的备用标签。
|
protected String |
html
HTML插入。
|
protected HTML.Tag |
parentTag
在文档中检查的标签。
|
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 |
---|
InsertHTMLTextAction(String name, String html, HTML.Tag parentTag, HTML.Tag addTag) |
InsertHTMLTextAction(String name, String html, HTML.Tag parentTag, HTML.Tag addTag, HTML.Tag alternateParentTag, HTML.Tag alternateAddTag) |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent ae)
将HTML插入到文档中。
|
protected void |
insertAtBoundary(JEditorPane editor, HTMLDocument doc, int offset, Element insertElement, String html, HTML.Tag parentTag, HTML.Tag addTag)
在插入边界时调用这一点。
|
protected void |
insertAtBoundry(JEditorPane editor, HTMLDocument doc, int offset, Element insertElement, String html, HTML.Tag parentTag, HTML.Tag addTag)
已弃用
从Java 2平台v1.3开始,使用insertAtBoundary
|
protected void |
insertHTML(JEditorPane editor, HTMLDocument doc, int offset, String html, int popDepth, int pushDepth, HTML.Tag addTag)
HTMLEditorKit.insertHTML的封面。
|
elementCountToTag, findElementMatchingTag, getElementsAt, getHTMLDocument, getHTMLEditorKit
getEditor, getStyledDocument, getStyledEditorKit, setCharacterAttributes, setParagraphAttributes
augmentList, getFocusedComponent, getTextComponent
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
protected String html
protected HTML.Tag parentTag
protected HTML.Tag addTag
protected HTML.Tag alternateParentTag
protected HTML.Tag alternateAddTag
public InsertHTMLTextAction(String name, String html, HTML.Tag parentTag, HTML.Tag addTag)
protected void insertHTML(JEditorPane editor, HTMLDocument doc, int offset, String html, int popDepth, int pushDepth, HTML.Tag addTag)
protected void insertAtBoundary(JEditorPane editor, HTMLDocument doc, int offset, Element insertElement, String html, HTML.Tag parentTag, HTML.Tag addTag)
@Deprecated protected void insertAtBoundry(JEditorPane editor, HTMLDocument doc, int offset, Element insertElement, String html, HTML.Tag parentTag, HTML.Tag addTag)
public void actionPerformed(ActionEvent ae)
ae
- the event
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.