javax.swing.text.html

Class MinimalHTMLWriter

public class MinimalHTMLWriter extends AbstractWriter

MinimalHTMLWriter, A minimal AbstractWriter implementation for HTML.
Constructor Summary
MinimalHTMLWriter(Writer w, StyledDocument doc)
Constructs a MinimalHTMLWriter.
MinimalHTMLWriter(Writer w, StyledDocument doc, int pos, int len)
Constructs a MinimalHTMLWriter.
Method Summary
protected voidendFontTag()
Ends a span tag.
protected booleaninFontTag()
Returns whether the writer is within two span tags.
protected booleanisText(Element elem)
Returns whether the element contains text or not.
protected voidstartFontTag(String style)
Starts a span tag.
protected voidtext(Element elem)
voidwrite()
Write the entire HTML document.
protected voidwriteAttributes(AttributeSet attr)
Write a set of attributes.
protected voidwriteBody()
Writes the body of the HTML document.
protected voidwriteComponent(Element elem)
Deliberately unimplemented, handles component elements.
protected voidwriteContent(Element elem, boolean needsIndenting)
Writes the content of an element.
protected voidwriteEndParagraph()
Write a paragraph end tag, closes any other open tags.
protected voidwriteEndTag(String endTag)
Write an ending tag and decrement the indent.
protected voidwriteHeader()
Write the HTML header.
protected voidwriteHTMLTags(AttributeSet attr)
Write bold, indent and underline tags.
protected voidwriteImage(Element elem)
Deliberately unimplemented.
protected voidwriteLeaf(Element e)
Writes a non-text leaf element.
protected voidwriteNonHTMLAttributes(AttributeSet attr)
Write the HTML attributes which do not have tag equivalents, e.g. attributes other than bold/italic/underlined.
protected voidwriteStartParagraph(Element elem)
Write a paragraph start tag.
protected voidwriteStartTag(String tag)
Write a start tag and increment the indent.
protected voidwriteStyles()
Write the styles used.

Constructor Detail

MinimalHTMLWriter

public MinimalHTMLWriter(Writer w, StyledDocument doc)
Constructs a MinimalHTMLWriter.

Parameters: w - a Writer, for output. doc - the document

MinimalHTMLWriter

public MinimalHTMLWriter(Writer w, StyledDocument doc, int pos, int len)
Constructs a MinimalHTMLWriter.

Parameters: w - a Writer, for output. doc - the document pos - start position len - length

Method Detail

endFontTag

protected void endFontTag()
Ends a span tag.

inFontTag

protected boolean inFontTag()
Returns whether the writer is within two span tags.

isText

protected boolean isText(Element elem)
Returns whether the element contains text or not.

startFontTag

protected void startFontTag(String style)
Starts a span tag.

text

protected void text(Element elem)

write

public void write()
Write the entire HTML document.

writeAttributes

protected void writeAttributes(AttributeSet attr)
Write a set of attributes.

writeBody

protected void writeBody()
Writes the body of the HTML document.

writeComponent

protected void writeComponent(Element elem)
Deliberately unimplemented, handles component elements.

writeContent

protected void writeContent(Element elem, boolean needsIndenting)
Writes the content of an element.

writeEndParagraph

protected void writeEndParagraph()
Write a paragraph end tag, closes any other open tags.

writeEndTag

protected void writeEndTag(String endTag)
Write an ending tag and decrement the indent.

writeHeader

protected void writeHeader()
Write the HTML header.

writeHTMLTags

protected void writeHTMLTags(AttributeSet attr)
Write bold, indent and underline tags.

writeImage

protected void writeImage(Element elem)
Deliberately unimplemented. Writes StyleConstants.IconElementName elements.

writeLeaf

protected void writeLeaf(Element e)
Writes a non-text leaf element.

writeNonHTMLAttributes

protected void writeNonHTMLAttributes(AttributeSet attr)
Write the HTML attributes which do not have tag equivalents, e.g. attributes other than bold/italic/underlined.

writeStartParagraph

protected void writeStartParagraph(Element elem)
Write a paragraph start tag.

writeStartTag

protected void writeStartTag(String tag)
Write a start tag and increment the indent.

writeStyles

protected void writeStyles()
Write the styles used.