public class MinimalHTMLWriter extends javax.swing.text.AbstractWriter
| Constructor and Description |
|---|
MinimalHTMLWriter(java.io.Writer w,
javax.swing.text.StyledDocument doc)
Constructs a MinimalHTMLWriter.
|
MinimalHTMLWriter(java.io.Writer w,
javax.swing.text.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(javax.swing.text.Element elem)
Returns whether the element contains text or not.
|
protected void |
startFontTag(java.lang.String style)
Starts a span tag.
|
protected void |
text(javax.swing.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(javax.swing.text.AttributeSet attr)
Write a set of attributes.
|
protected void |
writeBody()
Writes the body of the HTML document.
|
protected void |
writeComponent(javax.swing.text.Element elem)
Deliberately unimplemented, handles component elements.
|
protected void |
writeContent(javax.swing.text.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(java.lang.String endTag)
Write an ending tag and decrement the indent.
|
protected void |
writeHeader()
Write the HTML header.
|
protected void |
writeHTMLTags(javax.swing.text.AttributeSet attr)
Write bold, indent and underline tags.
|
protected void |
writeImage(javax.swing.text.Element elem)
Deliberately unimplemented.
|
protected void |
writeLeaf(javax.swing.text.Element e)
Writes a non-text leaf element.
|
protected void |
writeNonHTMLAttributes(javax.swing.text.AttributeSet attr)
Write the HTML attributes which do not have tag equivalents,
e.g. attributes other than bold/italic/underlined.
|
protected void |
writeStartParagraph(javax.swing.text.Element elem)
Write a paragraph start tag.
|
protected void |
writeStartTag(java.lang.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, writeLineSeparatorpublic MinimalHTMLWriter(java.io.Writer w, javax.swing.text.StyledDocument doc)
w - - a Writer, for output.doc - - the documentpublic MinimalHTMLWriter(java.io.Writer w, javax.swing.text.StyledDocument doc, int pos, int len)
w - - a Writer, for output.doc - - the documentpos - - start positionlen - - lengthprotected void startFontTag(java.lang.String style) throws java.io.IOException
java.io.IOExceptionprotected boolean inFontTag()
protected void endFontTag() throws java.io.IOException
java.io.IOExceptionpublic void write() throws java.io.IOException, javax.swing.text.BadLocationException
write in class javax.swing.text.AbstractWriterjava.io.IOExceptionjavax.swing.text.BadLocationExceptionprotected void writeStartTag(java.lang.String tag) throws java.io.IOException
java.io.IOExceptionprotected void writeEndTag(java.lang.String endTag) throws java.io.IOException
java.io.IOExceptionprotected void writeHeader() throws java.io.IOException
java.io.IOExceptionprotected void writeStartParagraph(javax.swing.text.Element elem) throws java.io.IOException
java.io.IOExceptionprotected void writeEndParagraph() throws java.io.IOException
java.io.IOExceptionprotected void writeBody() throws java.io.IOException, javax.swing.text.BadLocationException
java.io.IOExceptionjavax.swing.text.BadLocationExceptionprotected void text(javax.swing.text.Element elem) throws java.io.IOException, javax.swing.text.BadLocationException
javax.swing.text.AbstractWritertext in class javax.swing.text.AbstractWriterjava.io.IOExceptionjavax.swing.text.BadLocationExceptionprotected void writeHTMLTags(javax.swing.text.AttributeSet attr) throws java.io.IOException
java.io.IOExceptionprotected boolean isText(javax.swing.text.Element elem)
protected void writeContent(javax.swing.text.Element elem, boolean needsIndenting) throws java.io.IOException, javax.swing.text.BadLocationException
java.io.IOExceptionjavax.swing.text.BadLocationExceptionprotected void writeLeaf(javax.swing.text.Element e) throws java.io.IOException
java.io.IOExceptionprotected void writeNonHTMLAttributes(javax.swing.text.AttributeSet attr) throws java.io.IOException
java.io.IOExceptionprotected void writeStyles() throws java.io.IOException
java.io.IOExceptionprotected void writeAttributes(javax.swing.text.AttributeSet attr) throws java.io.IOException
writeAttributes in class javax.swing.text.AbstractWriterjava.io.IOExceptionprotected void writeComponent(javax.swing.text.Element elem) throws java.io.IOException
java.io.IOExceptionprotected void writeImage(javax.swing.text.Element elem) throws java.io.IOException
java.io.IOException