Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javax.swing.text.html
Class HTMLEditorKit.InsertHTMLTextAction  view HTMLEditorKit.InsertHTMLTextAction download HTMLEditorKit.InsertHTMLTextAction.java

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended byjavax.swing.text.TextAction
          extended byjavax.swing.text.StyledEditorKit.StyledTextAction
              extended byjavax.swing.text.html.HTMLEditorKit.HTMLTextAction
                  extended byjavax.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.


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  java.lang.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(java.lang.String name, java.lang.String html, HTML.Tag parentTag, HTML.Tag addTag)
          Initializes all fields.
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
 
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.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

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.

Constructor Detail

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

Method Detail

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.