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, parseBufferFields inherited from class javax.swing.text.html.HTMLEditorKit.ParserCallback
IMPLIED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleComment(char[] data, int pos) voidhandleEndTag(HTML.Tag tag, int pos) Handles end tag.voidhandleSimpleTag(HTML.Tag t, MutableAttributeSet a, int pos) SPAN tags are directed to handleSimpleTag by the parser.voidhandleStartTag(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, textAreaContentMethods 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:
handleStartTagin 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:
handleSimpleTagin 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:
handleEndTagin classHTMLDocument.HTMLReader
-
handleComment
public void handleComment(char[] data, int pos) - Overrides:
handleCommentin classHTMLDocument.HTMLReader
-