Class CustomHTMLAction

All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action

public class CustomHTMLAction extends HTMLEditorKit.HTMLTextAction
Author:
thevpc
See Also:
  • Field Details

    • html

      protected String html
      HTML to insert.
    • parentTag

      protected HTML.Tag parentTag
      Tag to check for in the document.
    • addTag

      protected HTML.Tag addTag
      Tag in HTML to start adding tags from.
    • alternateParentTag

      protected HTML.Tag alternateParentTag
      Alternate Tag to check for in the document if parentTag is not found.
    • alternateAddTag

      protected HTML.Tag alternateAddTag
      Alternate tag in HTML to start adding tags from if parentTag is not found and alternateParentTag is found.
  • Constructor Details

  • Method Details

    • insertHTML

      protected void insertHTML(JEditorPane editor, HTMLDocument doc, int offset, String html, int popDepth, int pushDepth, HTML.Tag addTag)
      A cover for HTMLEditorKit.insertHTML.If an exception it thrown it is wrapped in a RuntimeException and thrown.
      Parameters:
      editor - editor
      doc - doc
      offset - offset
      html - html
      popDepth - popDepth
      pushDepth - pushDepth
      addTag - addTag
    • commonParent

      protected Element commonParent(JEditorPane editor, HTMLDocument doc, int offset)
    • insertAtBoundary

      protected void insertAtBoundary(JEditorPane editor, HTMLDocument doc, int offset, Element insertElement, String html, HTML.Tag parentTag, HTML.Tag addTag)
      This is invoked when inserting at a boundary. It determines the number of pops, and then the number of pushes that need to be performed, and then invokes insertHTML.
      Parameters:
      editor - editor
      doc - doc
      offset - offset
      insertElement - insertElement
      html - html
      parentTag - parentTag
      addTag - addTag
      Since:
      1.3
    • actionPerformed

      public void actionPerformed(ActionEvent ae)
      Inserts the HTML into the document.
      Parameters:
      ae - the event