|
JavaTM 2 Platform Standard Edition |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.text.AbstractWriter | +--javax.swing.text.html.HTMLWriter
This is a writer for HTMLDocuments.
Fields inherited from class javax.swing.text.AbstractWriter |
NEWLINE |
Constructor Summary | |
HTMLWriter(Writer w,
HTMLDocument doc)
Creates a new HTMLWriter. |
|
HTMLWriter(Writer w,
HTMLDocument doc,
int pos,
int len)
Creates a new HTMLWriter. |
Method Summary | |
protected void |
closeOutUnwantedEmbeddedTags(AttributeSet attr)
This method searches the attribute set and for each tag that is stored in the tag vector. |
protected void |
comment(Element elem)
Writes out comments. |
protected void |
decrIndent()
Decrements the indent level. |
protected void |
emptyTag(Element elem)
Writes out all empty elements i.e tags that have no corresponding end tag. |
protected void |
endTag(Element elem)
Writes out an end tag for the element. |
protected void |
incrIndent()
Increments the indent level. |
protected void |
indent()
Does indentation. |
protected boolean |
isBlockTag(AttributeSet attr)
Determines if the HTML.Tag associated with the element is a block tag. |
protected boolean |
matchNameAttribute(AttributeSet attr,
HTML.Tag tag)
This method return true if the StyleConstants.NameAttribute is equal to the tag that is passed in as a parameter. |
protected void |
selectContent(AttributeSet attr)
Writes out the content of the SELECT form element. |
protected void |
setIndentSpace(int space)
Enables subclasses to specify how many spaces an indent maps to. |
protected void |
setLineLength(int l)
Enables subclasses to set the number of characters they want written per line. |
protected void |
startTag(Element elem)
Writes out a start tag for the element. |
protected boolean |
synthesizedElement(Element elem)
This method returns true, if the element is a synthesized element. |
protected void |
text(Element elem)
Writes out text. |
protected void |
textAreaContent(AttributeSet attr)
Writes out text that is contained in a TEXTAREA form element. |
void |
write()
This is method that iterates over the the Element tree and controls the writing out of all the tags and its attributes. |
protected void |
write(char ch)
Conveneice method for write(char, false). |
protected void |
write(String content)
Convenience method for write(String, false). |
protected void |
writeAttributes(AttributeSet attr)
Writes out the attribute set. |
protected void |
writeEmbeddedTags(AttributeSet attr)
This method searches for embedded tags in the AttributeSet and writes them out. |
protected void |
writeOption(Option option)
Writes out the content of the Option form element. |
Methods inherited from class javax.swing.text.AbstractWriter |
getDocument,
getElementIterator,
getText,
inRange |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public HTMLWriter(Writer w, HTMLDocument doc)
a
- Writeran
- HTMLDocumentpublic HTMLWriter(Writer w, HTMLDocument doc, int pos, int len)
a
- Writeran
- HTMLDocumentpos
- The location in the document to fetch the
content.len
- The amount to write out.Method Detail |
public void write() throws IOException, BadLocationException
protected void writeAttributes(AttributeSet attr) throws IOException
an
- AttributeSet.protected void emptyTag(Element elem) throws BadLocationException, IOException
an
- Element.protected boolean isBlockTag(AttributeSet attr)
AttributeSet.
- protected void startTag(Element elem) throws IOException, BadLocationException
an
- Element.protected void textAreaContent(AttributeSet attr) throws BadLocationException, IOException
AttributeSet
- protected void text(Element elem) throws BadLocationException, IOException
an
- Element.protected void selectContent(AttributeSet attr) throws IOException
AttributeSet
- associcated with the form element.protected void writeOption(Option option) throws IOException
Option.
- protected void endTag(Element elem) throws IOException
an
- Element.protected void comment(Element elem) throws BadLocationException, IOException
an
- element.protected boolean synthesizedElement(Element elem)
protected boolean matchNameAttribute(AttributeSet attr, HTML.Tag tag)
protected void writeEmbeddedTags(AttributeSet attr) throws IOException
protected void closeOutUnwantedEmbeddedTags(AttributeSet attr) throws IOException
protected void setIndentSpace(int space)
an
- int representing the space to indent mapping.protected void incrIndent()
protected void decrIndent()
protected void setLineLength(int l)
the
- maximum line length.protected void write(char ch) throws IOException
a
- char.protected void write(String content) throws IOException
a
- String.protected void indent() throws IOException
|
JavaTM 2 Platform Standard Edition |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |