javax.swing.text.html
public class MinimalHTMLWriter extends AbstractWriter
NEWLINE
Constructor and Description |
---|
MinimalHTMLWriter(Writer w,
StyledDocument doc)
Constructs a MinimalHTMLWriter.
|
MinimalHTMLWriter(Writer w,
StyledDocument doc,
int pos,
int len)
Constructs a MinimalHTMLWriter.
|
Modifier and Type | Method and Description |
---|---|
protected void |
endFontTag()
Ends a span tag.
|
protected boolean |
inFontTag()
Returns whether the writer is within two span tags.
|
protected boolean |
isText(Element elem)
Returns whether the element contains text or not.
|
protected void |
startFontTag(String style)
Starts a span tag.
|
protected void |
text(Element elem)
Output the text of the indicated Element, properly clipping it to
the range of the Document specified when the AbstractWriter was
created.
|
void |
write()
Write the entire HTML document.
|
protected void |
writeAttributes(AttributeSet attr)
Write a set of attributes.
|
protected void |
writeBody()
Writes the body of the HTML document.
|
protected void |
writeComponent(Element elem)
Deliberately unimplemented, handles component elements.
|
protected void |
writeContent(Element elem,
boolean needsIndenting)
Writes the content of an element.
|
protected void |
writeEndParagraph()
Write a paragraph end tag, closes any other open tags.
|
protected void |
writeEndTag(String endTag)
Write an ending tag and decrement the indent.
|
protected void |
writeHeader()
Write the HTML header.
|
protected void |
writeHTMLTags(AttributeSet attr)
Write bold, indent and underline tags.
|
protected void |
writeImage(Element elem)
Deliberately unimplemented.
|
protected void |
writeLeaf(Element e)
Writes a non-text leaf element.
|
protected void |
writeNonHTMLAttributes(AttributeSet attr)
Write the HTML attributes which do not have tag equivalents,
e.g. attributes other than bold/italic/underlined.
|
protected void |
writeStartParagraph(Element elem)
Write a paragraph start tag.
|
protected void |
writeStartTag(String tag)
Write a start tag and increment the indent.
|
protected void |
writeStyles()
Write the styles used.
|
decrIndent, getCanWrapLines, getCurrentLineLength, getDocument, getElementIterator, getEndOffset, getIndentLevel, getIndentSpace, getLineLength, getLineSeparator, getStartOffset, getText, getWriter, incrIndent, indent, inRange, isLineEmpty, output, setCanWrapLines, setCurrentLineLength, setIndentSpace, setLineLength, setLineSeparator, write, write, write, writeLineSeparator
public MinimalHTMLWriter(Writer w, StyledDocument doc)
w
- - a Writer, for output.doc
- - the documentpublic MinimalHTMLWriter(Writer w, StyledDocument doc, int pos, int len)
w
- - a Writer, for output.doc
- - the documentpos
- - start positionlen
- - lengthprotected void startFontTag(String style) throws IOException
IOException
protected boolean inFontTag()
protected void endFontTag() throws IOException
IOException
public void write() throws IOException, BadLocationException
write
in class AbstractWriter
IOException
BadLocationException
protected void writeStartTag(String tag) throws IOException
IOException
protected void writeEndTag(String endTag) throws IOException
IOException
protected void writeHeader() throws IOException
IOException
protected void writeStartParagraph(Element elem) throws IOException
IOException
protected void writeEndParagraph() throws IOException
IOException
protected void writeBody() throws IOException, BadLocationException
IOException
BadLocationException
protected void text(Element elem) throws IOException, BadLocationException
AbstractWriter
text
in class AbstractWriter
IOException
BadLocationException
protected void writeHTMLTags(AttributeSet attr) throws IOException
IOException
protected void writeContent(Element elem, boolean needsIndenting) throws IOException, BadLocationException
IOException
BadLocationException
protected void writeLeaf(Element e) throws IOException
IOException
protected void writeNonHTMLAttributes(AttributeSet attr) throws IOException
IOException
protected void writeStyles() throws IOException
IOException
protected void writeAttributes(AttributeSet attr) throws IOException
writeAttributes
in class AbstractWriter
IOException
protected void writeComponent(Element elem) throws IOException
IOException
protected void writeImage(Element elem) throws IOException
IOException