Package com.lightdev.app.shtm
Class SHTMLDocument.SHTMLReader
java.lang.Object
javax.swing.text.html.HTMLEditorKit.ParserCallback
javax.swing.text.html.HTMLDocument.HTMLReader
com.lightdev.app.shtm.SHTMLDocument.SHTMLReader
- Enclosing class:
SHTMLDocument
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
HTMLDocument.HTMLReader.BlockAction, HTMLDocument.HTMLReader.CharacterAction, HTMLDocument.HTMLReader.FormAction, HTMLDocument.HTMLReader.HiddenAction, HTMLDocument.HTMLReader.IsindexAction, HTMLDocument.HTMLReader.ParagraphAction, HTMLDocument.HTMLReader.PreAction, HTMLDocument.HTMLReader.SpecialAction, 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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
handleComment
(char[] data, int pos) void
handleEndTag
(HTML.Tag tag, int pos) Handles end tag.void
handleSimpleTag
(HTML.Tag t, MutableAttributeSet a, int pos) SPAN tags are directed to handleSimpleTag by the parser.void
handleStartTag
(HTML.Tag tag, 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
-
Constructor Details
-
SHTMLReader
public SHTMLReader(int offset, boolean emptyDocument) Constructor
-
-
Method Details
-
handleStartTag
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 classHTMLDocument.HTMLReader
-
handleSimpleTag
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 classHTMLDocument.HTMLReader
-
handleEndTag
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 classHTMLDocument.HTMLReader
-
handleComment
public void handleComment(char[] data, int pos) - Overrides:
handleComment
in classHTMLDocument.HTMLReader
-