javax.swing.text.html
public class HTMLDocument.HTMLReader extends HTMLEditorKit.ParserCallback
Nested Class Summary | |
---|---|
class | HTMLDocument.HTMLReader.BlockAction |
class | HTMLDocument.HTMLReader.CharacterAction |
class | HTMLDocument.HTMLReader.FormAction
Processes elements that make up forms: <input>, <textarea>,
<select> and <option>. |
class | HTMLDocument.HTMLReader.HiddenAction
This action indicates that the content between starting and closing HTML
elements (like script - /script) should not be visible. |
class | HTMLDocument.HTMLReader.IsindexAction
Handles <isindex> tags. |
class | HTMLDocument.HTMLReader.ParagraphAction |
class | HTMLDocument.HTMLReader.PreAction
This action is performed when a <pre> tag is parsed. |
class | HTMLDocument.HTMLReader.SpecialAction
Inserts the elements that are represented by ths single tag with
attributes (only). |
class | HTMLDocument.HTMLReader.TagAction |
Field Summary | |
---|---|
protected MutableAttributeSet | charAttr
Holds the current character attribute set * |
protected Vector<ElementSpec> | parseBuffer |
Constructor Summary | |
---|---|
HTMLReader(int offset) | |
HTMLReader(int offset, int popDepth, int pushDepth, HTML.Tag insertTag) |
Method Summary | |
---|---|
protected void | addContent(char[] data, int offs, int length)
Adds text to the appropriate context using the current character
attribute set.
|
protected void | addContent(char[] data, int offs, int length, boolean generateImpliedPIfNecessary)
Adds text to the appropriate context using the current character
attribute set, and possibly generating an IMPLIED Tag if necessary.
|
protected void | addSpecialElement(HTML.Tag t, MutableAttributeSet a)
Adds content that is specified in the attribute set.
|
protected void | blockClose(HTML.Tag t)
Instructs the parse buffer to close the block element associated with
the given HTML.Tag
|
protected void | blockOpen(HTML.Tag t, MutableAttributeSet attr)
Instructs the parse buffer to create a block element with the given
attributes.
|
void | flush()
This is the last method called on the HTMLReader, allowing any pending
changes to be flushed to the HTMLDocument. |
void | handleComment(char[] data, int pos)
This method called by parser to handle a comment block.
|
void | handleEndOfLineString(String eol)
This is invoked after the stream has been parsed but before it has been
flushed.
|
void | handleEndTag(HTML.Tag t, int pos)
This method is called by the parser and should route the call to the
proper handler for the tag.
|
void | handleSimpleTag(HTML.Tag t, MutableAttributeSet a, int pos)
This is a callback from the parser that should be routed to the
appropriate handler for the tag.
|
void | handleStartTag(HTML.Tag t, MutableAttributeSet a, int pos)
This method is called by the parser and should route the call to the
proper handler for the tag.
|
void | handleText(char[] data, int pos)
This method is called by the parser to indicate a block of
text was encountered. |
protected void | popCharacterStyle()
Pops a character style off of the stack and uses it as the
current character style.
|
protected void | preContent(char[] data)
Adds the given text that was encountered in a element. |
protected void | pushCharacterStyle()
Pushes the current character style onto the stack.
|
protected void | registerTag(HTML.Tag t, HTMLDocument.HTMLReader.TagAction a)
Registers a given tag with a given Action. |
protected void | textAreaContent(char[] data)
Adds the given text to the textarea document. |
Parameters: data the text to add offs the offset at which to add it length the length of the text to add
Parameters: data the text to add offs the offset at which to add it length the length of the text to add generateImpliedPIfNecessary whether or not we should generate an HTML.Tag.IMPLIED tag if necessary
Parameters: t the HTML.Tag a the attribute set specifying the special content
Parameters: t the HTML.Tag that is closing its block
Parameters: t the tag that requires opening a new block attr the attribute set for the new block
Parameters: data the comment pos the position at which the comment was encountered
Parameters: eol one of \n, \r, or \r\n, whichever was encountered the most in parsing the stream
Since: 1.3
Parameters: t the HTML.Tag pos the position at which the tag was encountered
Parameters: t the HTML.Tag that was encountered a the attribute set pos the position at which the tag was encountered
Parameters: t the HTML.Tag a the attribute set pos the position at which the tag was encountered
Parameters: data the text that was inserted pos the position at which the text was inserted
element. This adds synthesized lines to hold the text runs.Parameters: data the text
Parameters: t the Tag to register a the Action for the Tag
Parameters: data the text to add to the textarea