java.lang.Object
javax.swing.AbstractAction
javax.swing.text.TextAction
javax.swing.text.StyledEditorKit.StyledTextAction
javax.swing.text.html.HTMLEditorKit.HTMLTextAction
javax.swing.text.html.HTMLEditorKit.InsertHTMLTextAction
- All Implemented Interfaces:
- javax.swing.Action, java.awt.event.ActionListener, java.lang.Cloneable, java.util.EventListener, java.io.Serializable
- Enclosing class:
- HTMLEditorKit
- public static class HTMLEditorKit.InsertHTMLTextAction
- extends HTMLEditorKit.HTMLTextAction
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.
Method Summary |
void |
actionPerformed(java.awt.event.ActionEvent ae)
Inserts the HTML. |
protected void |
insertAtBoundary(javax.swing.JEditorPane editor,
HTMLDocument doc,
int offset,
javax.swing.text.Element insertElement,
java.lang.String html,
HTML.Tag parentTag,
HTML.Tag addTag)
Invoked when inserting at a boundary. |
protected void |
insertAtBoundry(javax.swing.JEditorPane editor,
HTMLDocument doc,
int offset,
javax.swing.text.Element insertElement,
java.lang.String html,
HTML.Tag parentTag,
HTML.Tag addTag)
Deprecated. as of v1.3, use insertAtBoundary |
protected void |
insertHTML(javax.swing.JEditorPane editor,
HTMLDocument doc,
int offset,
java.lang.String html,
int popDepth,
int pushDepth,
HTML.Tag addTag)
HTMLEditorKit.insertHTML is called. |
Methods inherited from class javax.swing.text.StyledEditorKit.StyledTextAction |
getEditor, getStyledDocument, getStyledEditorKit, setCharacterAttributes, setParagraphAttributes |
addTag
protected HTML.Tag addTag
- Tag in HTML to start adding tags from.
alternateAddTag
protected HTML.Tag alternateAddTag
- Alternate tag in HTML to start adding tags from if parentTag is
not found and alternateParentTag is not found.
alternateParentTag
protected HTML.Tag alternateParentTag
- Alternate tag to check if parentTag is not found.
html
protected java.lang.String html
- HTML to insert.
parentTag
protected HTML.Tag parentTag
- Tag to check for in the document.
HTMLEditorKit.InsertHTMLTextAction
public HTMLEditorKit.InsertHTMLTextAction(java.lang.String name,
java.lang.String html,
HTML.Tag parentTag,
HTML.Tag addTag)
- Initializes all fields.
HTMLEditorKit.InsertHTMLTextAction
public HTMLEditorKit.InsertHTMLTextAction(java.lang.String name,
java.lang.String html,
HTML.Tag parentTag,
HTML.Tag addTag,
HTML.Tag alternateParentTag,
HTML.Tag alternateAddTag)
- Initializes all fields and calls super
insertHTML
protected void insertHTML(javax.swing.JEditorPane editor,
HTMLDocument doc,
int offset,
java.lang.String html,
int popDepth,
int pushDepth,
HTML.Tag addTag)
- HTMLEditorKit.insertHTML is called. If an exception is
thrown, it is wrapped in a RuntimeException and thrown.
insertAtBoundary
protected void insertAtBoundary(javax.swing.JEditorPane editor,
HTMLDocument doc,
int offset,
javax.swing.text.Element insertElement,
java.lang.String html,
HTML.Tag parentTag,
HTML.Tag addTag)
throws gnu.classpath.NotImplementedException
- Invoked when inserting at a boundary. Determines the number of pops,
and then the number of pushes that need to be performed. The it calls
insertHTML.
insertAtBoundry
protected void insertAtBoundry(javax.swing.JEditorPane editor,
HTMLDocument doc,
int offset,
javax.swing.text.Element insertElement,
java.lang.String html,
HTML.Tag parentTag,
HTML.Tag addTag)
- Deprecated. as of v1.3, use insertAtBoundary
- Invoked when inserting at a boundary. Determines the number of pops,
and then the number of pushes that need to be performed. The it calls
insertHTML.
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent ae)
- Inserts the HTML.