javax.swing.text.html
Class HTMLDocument.HTMLReader
- HTMLDocument
A reader to load an HTMLDocument with HTML structure.
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.
|
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
addContent
protected void addContent(char[] data,
int offs,
int length)
Adds text to the appropriate context using the current character
attribute set.
data
- the text to addoffs
- the offset at which to add itlength
- the length of the text to add
addContent
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.
data
- the text to addoffs
- the offset at which to add itlength
- the length of the text to addgenerateImpliedPIfNecessary
- whether or not we should generate
an HTML.Tag.IMPLIED tag if necessary
blockClose
protected void blockClose(HTML.Tag t)
Instructs the parse buffer to close the block element associated with
the given HTML.Tag
t
- the HTML.Tag that is closing its block
blockOpen
protected void blockOpen(HTML.Tag t,
MutableAttributeSet attr)
Instructs the parse buffer to create a block element with the given
attributes.
t
- the tag that requires opening a new blockattr
- the attribute set for the new block
handleText
public void handleText(char[] data,
int pos)
This method is called by the parser to indicate a block of
text was encountered. Should insert the text appropriately.
- handleText in interface HTMLEditorKit.ParserCallback
data
- the text that was insertedpos
- the position at which the text was inserted
popCharacterStyle
protected void popCharacterStyle()
Pops a character style off of the stack and uses it as the
current character style.
preContent
protected void preContent(char[] data)
Adds the given text that was encountered in a
element.
This adds synthesized lines to hold the text runs.
pushCharacterStyle
protected void pushCharacterStyle()
Pushes the current character style onto the stack.
registerTag
protected void registerTag(HTML.Tag t,
HTMLDocument.HTMLReader.TagAction a)
Registers a given tag with a given Action. All of the well-known tags
are registered by default, but this method can change their behaviour
or add support for custom or currently unsupported tags.
t
- the Tag to registera
- the Action for the Tag
textAreaContent
protected void textAreaContent(char[] data)
Adds the given text to the textarea document. Called only when we are
within a textarea.
data
- the text to add to the textarea
HTMLDocument.java --
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.