Class SHTMLDocument.SHTMLReader

  • Enclosing class:
    SHTMLDocument

    public class SHTMLDocument.SHTMLReader
    extends javax.swing.text.html.HTMLDocument.HTMLReader
    This reader extends HTMLDocument.HTMLReader by the capability to handle SPAN tags
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.text.html.HTMLDocument.HTMLReader

        javax.swing.text.html.HTMLDocument.HTMLReader.BlockAction, javax.swing.text.html.HTMLDocument.HTMLReader.CharacterAction, javax.swing.text.html.HTMLDocument.HTMLReader.FormAction, javax.swing.text.html.HTMLDocument.HTMLReader.HiddenAction, javax.swing.text.html.HTMLDocument.HTMLReader.IsindexAction, javax.swing.text.html.HTMLDocument.HTMLReader.ParagraphAction, javax.swing.text.html.HTMLDocument.HTMLReader.PreAction, javax.swing.text.html.HTMLDocument.HTMLReader.SpecialAction, javax.swing.text.html.HTMLDocument.HTMLReader.TagAction
    • Field Summary

      • Fields inherited from class javax.swing.text.html.HTMLDocument.HTMLReader

        charAttr, parseBuffer
      • Fields inherited from class javax.swing.text.html.HTMLEditorKit.ParserCallback

        IMPLIED
    • Constructor Summary

      Constructors 
      Constructor Description
      SHTMLReader​(int offset, boolean emptyDocument)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void handleComment​(char[] data, int pos)  
      void handleEndTag​(javax.swing.text.html.HTML.Tag tag, int pos)
      Handles end tag.
      void handleSimpleTag​(javax.swing.text.html.HTML.Tag t, javax.swing.text.MutableAttributeSet a, int pos)
      SPAN tags are directed to handleSimpleTag by the parser.
      void handleStartTag​(javax.swing.text.html.HTML.Tag tag, javax.swing.text.MutableAttributeSet attributeSet, int pos)
      Handles the start tag received by the parser.
      • Methods inherited from class javax.swing.text.html.HTMLDocument.HTMLReader

        addContent, addContent, addSpecialElement, blockClose, blockOpen, flush, handleEndOfLineString, handleText, popCharacterStyle, preContent, pushCharacterStyle, registerTag, textAreaContent
      • Methods inherited from class javax.swing.text.html.HTMLEditorKit.ParserCallback

        handleError
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SHTMLReader

        public SHTMLReader​(int offset,
                           boolean emptyDocument)
        Constructor
    • Method Detail

      • handleStartTag

        public void handleStartTag​(javax.swing.text.html.HTML.Tag tag,
                                   javax.swing.text.MutableAttributeSet attributeSet,
                                   int pos)
        Handles the start tag received by the parser. If it is a SPAN tag, converts the contents of the STYLE attribute to an AttributeSet, and adds it to the contents of this tag. Otherwise lets HTMLDocument.HTMLReader do the work.
        Overrides:
        handleStartTag in class javax.swing.text.html.HTMLDocument.HTMLReader
      • handleSimpleTag

        public void handleSimpleTag​(javax.swing.text.html.HTML.Tag t,
                                    javax.swing.text.MutableAttributeSet a,
                                    int pos)
        SPAN tags are directed to handleSimpleTag by the parser. If a SPAN tag is detected in this method, it gets redirected to handleStartTag and handleEndTag respectively.
        Overrides:
        handleSimpleTag in class javax.swing.text.html.HTMLDocument.HTMLReader
      • handleEndTag

        public void handleEndTag​(javax.swing.text.html.HTML.Tag tag,
                                 int pos)
        Handles end tag. If a SPAN tag is directed to this method, end its action, otherwise, let HTMLDocument.HTMLReader do the work
        Overrides:
        handleEndTag in class javax.swing.text.html.HTMLDocument.HTMLReader
      • handleComment

        public void handleComment​(char[] data,
                                  int pos)
        Overrides:
        handleComment in class javax.swing.text.html.HTMLDocument.HTMLReader