|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.AbstractAction
javax.swing.text.TextAction
javax.swing.text.StyledEditorKit.StyledTextAction
javax.swing.text.html.HTMLEditorKit.HTMLTextAction
javax.swing.text.html.HTMLEditorKit.InsertHTMLTextAction
public static class HTMLEditorKit.InsertHTMLTextAction
This class is used to insert a string of HTML into an existing document. At least 2 HTML.Tags need to be supplied. The first Tag (parentTag) identifies the parent in the document to add the elements to. The second, (addTag), identifies that the first tag should be added to the document as seen in the string. The parser will generate all appropriate (opening/closing tags_ even if they are not in the HTML string passed in.
Field Summary | |
---|---|
protected HTML.Tag |
addTag
Tag in HTML to start adding tags from. |
protected HTML.Tag |
alternateAddTag
Alternate tag in HTML to start adding tags from if parentTag is not found and alternateParentTag is not found. |
protected HTML.Tag |
alternateParentTag
Alternate tag to check if parentTag is not found. |
protected String |
html
HTML to insert. |
protected HTML.Tag |
parentTag
Tag to check for in the document. |
Fields inherited from class javax.swing.AbstractAction |
---|
changeSupport, enabled |
Fields inherited from interface javax.swing.Action |
---|
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON |
Constructor Summary | |
---|---|
HTMLEditorKit.InsertHTMLTextAction(String name,
String html,
HTML.Tag parentTag,
HTML.Tag addTag)
Initializes all fields. |
|
HTMLEditorKit.InsertHTMLTextAction(String name,
String html,
HTML.Tag parentTag,
HTML.Tag addTag,
HTML.Tag alternateParentTag,
HTML.Tag alternateAddTag)
Initializes all fields and calls super |
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent ae)
Inserts the HTML. |
protected void |
insertAtBoundary(JEditorPane editor,
HTMLDocument doc,
int offset,
Element insertElement,
String html,
HTML.Tag parentTag,
HTML.Tag addTag)
Invoked when inserting at a boundary. |
protected void |
insertAtBoundry(JEditorPane editor,
HTMLDocument doc,
int offset,
Element insertElement,
String html,
HTML.Tag parentTag,
HTML.Tag addTag)
Deprecated. as of v1.3, use insertAtBoundary |
protected void |
insertHTML(JEditorPane editor,
HTMLDocument doc,
int offset,
String html,
int popDepth,
int pushDepth,
HTML.Tag addTag)
HTMLEditorKit.insertHTML is called. |
Methods inherited from class javax.swing.text.html.HTMLEditorKit.HTMLTextAction |
---|
elementCountToTag, findElementMatchingTag, getElementsAt, getHTMLDocument, getHTMLEditorKit |
Methods inherited from class javax.swing.text.StyledEditorKit.StyledTextAction |
---|
getEditor, getStyledDocument, getStyledEditorKit, setCharacterAttributes, setParagraphAttributes |
Methods inherited from class javax.swing.text.TextAction |
---|
augmentList, getFocusedComponent, getTextComponent |
Methods inherited from class javax.swing.AbstractAction |
---|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected HTML.Tag addTag
protected HTML.Tag alternateAddTag
protected HTML.Tag alternateParentTag
protected String html
protected HTML.Tag parentTag
Constructor Detail |
---|
public HTMLEditorKit.InsertHTMLTextAction(String name, String html, HTML.Tag parentTag, HTML.Tag addTag)
name
- - the name of the document.html
- - the html to insertparentTag
- - the parent tag to check foraddTag
- - the tag to start adding frompublic HTMLEditorKit.InsertHTMLTextAction(String name, String html, HTML.Tag parentTag, HTML.Tag addTag, HTML.Tag alternateParentTag, HTML.Tag alternateAddTag)
name
- - the name of the document.html
- - the html to insertparentTag
- - the parent tag to check foraddTag
- - the tag to start adding fromalternateParentTag
- - the alternate parent tagalternateAddTag
- - the alternate add tagMethod Detail |
---|
protected void insertHTML(JEditorPane editor, HTMLDocument doc, int offset, String html, int popDepth, int pushDepth, HTML.Tag addTag)
editor
- - the editor to use to get the editorkitdoc
- -
the Document to insert the HTML into.offset
- -
where to begin inserting the HTML.html
- -
the String to insertpopDepth
- -
the number of ElementSpec.EndTagTypes to generate before
insertingpushDepth
- -
the number of ElementSpec.StartTagTypes with a direction of
ElementSpec.JoinNextDirection that should be generated beforeaddTag
- -
the first tag to start inserting into documentprotected void insertAtBoundary(JEditorPane editor, HTMLDocument doc, int offset, Element insertElement, String html, HTML.Tag parentTag, HTML.Tag addTag)
editor
- -
the editor to use to get the editorkitdoc
- -
the Document to insert the HTML into.offset
- -
where to begin inserting the HTML.insertElement
- -
the element to inserthtml
- -
the html to insertparentTag
- -
the parent tagaddTag
- -
the first tagprotected void insertAtBoundry(JEditorPane editor, HTMLDocument doc, int offset, Element insertElement, String html, HTML.Tag parentTag, HTML.Tag addTag)
editor
- - the editor to use to get the editorkitdoc
- -
the Document to insert the HTML into.offset
- -
where to begin inserting the HTML.insertElement
- - the element to inserthtml
- - the html to insertparentTag
- - the parent tagaddTag
- - the first tagpublic void actionPerformed(ActionEvent ae)
ae
- - the action performed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |