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, writeLineSeparatorpublic 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
IOExceptionprotected boolean inFontTag()
protected void endFontTag() throws IOException
IOExceptionpublic void write() throws IOException, BadLocationException
write in class AbstractWriterIOExceptionBadLocationExceptionprotected void writeStartTag(String tag) throws IOException
IOExceptionprotected void writeEndTag(String endTag) throws IOException
IOExceptionprotected void writeHeader() throws IOException
IOExceptionprotected void writeStartParagraph(Element elem) throws IOException
IOExceptionprotected void writeEndParagraph() throws IOException
IOExceptionprotected void writeBody() throws IOException, BadLocationException
IOExceptionBadLocationExceptionprotected void text(Element elem) throws IOException, BadLocationException
AbstractWritertext in class AbstractWriterIOExceptionBadLocationExceptionprotected void writeHTMLTags(AttributeSet attr) throws IOException
IOExceptionprotected void writeContent(Element elem, boolean needsIndenting) throws IOException, BadLocationException
IOExceptionBadLocationExceptionprotected void writeLeaf(Element e) throws IOException
IOExceptionprotected void writeNonHTMLAttributes(AttributeSet attr) throws IOException
IOExceptionprotected void writeStyles() throws IOException
IOExceptionprotected void writeAttributes(AttributeSet attr) throws IOException
writeAttributes in class AbstractWriterIOExceptionprotected void writeComponent(Element elem) throws IOException
IOExceptionprotected void writeImage(Element elem) throws IOException
IOException