|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.text.AbstractWriter
javax.swing.text.html.HTMLWriter
com.lightdev.app.shtm.FixedHTMLWriter
public class FixedHTMLWriter
FixedHTMLWriter
This is the standard HTMLWriter from package javax.swing.text.html. It only has been changed in method 'createFontAttribute' so that font sizes are written correctly inside content
.
Field Summary |
---|
Fields inherited from class javax.swing.text.AbstractWriter |
---|
NEWLINE |
Constructor Summary | |
---|---|
FixedHTMLWriter(java.io.Writer w,
javax.swing.text.html.HTMLDocument doc)
Creates a new HTMLWriter. |
|
FixedHTMLWriter(java.io.Writer w,
javax.swing.text.html.HTMLDocument doc,
int pos,
int len)
Creates a new HTMLWriter. |
Method Summary | |
---|---|
protected void |
closeOutUnwantedEmbeddedTags(javax.swing.text.AttributeSet attr)
Searches the attribute set and for each tag that is stored in the tag vector. |
protected void |
comment(javax.swing.text.Element elem)
Writes out comments. |
protected void |
emptyTag(javax.swing.text.Element elem)
Writes out all empty elements (all tags that have no corresponding end tag). |
protected void |
endTag(javax.swing.text.Element elem)
Writes out an end tag for the element. |
protected boolean |
isBlockTag(javax.swing.text.AttributeSet attr)
Determines if the HTML.Tag associated with the element is a block tag. |
protected boolean |
matchNameAttribute(javax.swing.text.AttributeSet attr,
javax.swing.text.html.HTML.Tag tag)
Returns true if the StyleConstants.NameAttribute is equal to the tag that is passed in as a parameter. |
protected void |
output(char[] chars,
int start,
int length)
This method is overriden to map any character entities, such as < to <. |
protected void |
selectContent(javax.swing.text.AttributeSet attr)
Writes out the content of the SELECT form element. |
protected void |
startTag(javax.swing.text.Element elem)
Writes out a start tag for the element. |
protected boolean |
synthesizedElement(javax.swing.text.Element elem)
Returns true if the element is a synthesized element. |
protected void |
text(javax.swing.text.Element elem)
Writes out text. |
protected void |
textAreaContent(javax.swing.text.AttributeSet attr)
Writes out text that is contained in a TEXTAREA form element. |
void |
write()
Iterates over the Element tree and controls the writing out of all the tags and its attributes. |
protected void |
writeAttributes(javax.swing.text.AttributeSet attr)
Writes out the attribute set. |
protected void |
writeEmbeddedTags(javax.swing.text.AttributeSet attr)
Searches for embedded tags in the AttributeSet and writes them out. |
protected void |
writeLineSeparator()
Writes the line separator. |
protected void |
writeOption(javax.swing.text.html.Option option)
Writes out the content of the Option form element. |
Methods inherited from class javax.swing.text.AbstractWriter |
---|
decrIndent, getCanWrapLines, getCurrentLineLength, getDocument, getElementIterator, getEndOffset, getIndentLevel, getIndentSpace, getLineLength, getLineSeparator, getStartOffset, getText, getWriter, incrIndent, indent, inRange, isLineEmpty, setCanWrapLines, setCurrentLineLength, setIndentSpace, setLineLength, setLineSeparator, write, write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FixedHTMLWriter(java.io.Writer w, javax.swing.text.html.HTMLDocument doc)
w
- a Writerdoc
- an HTMLDocumentpublic FixedHTMLWriter(java.io.Writer w, javax.swing.text.html.HTMLDocument doc, int pos, int len)
w
- a Writerdoc
- an HTMLDocumentpos
- the document location from which to fetch the contentlen
- the amount to write outMethod Detail |
---|
public void write() throws java.io.IOException, javax.swing.text.BadLocationException
write
in class javax.swing.text.html.HTMLWriter
java.io.IOException
- on any I/O error
javax.swing.text.BadLocationException
- if pos represents an invalid
location within the document.protected void writeAttributes(javax.swing.text.AttributeSet attr) throws java.io.IOException
writeAttributes
in class javax.swing.text.html.HTMLWriter
attr
- an AttributeSet
java.io.IOException
- on any I/O errorprotected void emptyTag(javax.swing.text.Element elem) throws javax.swing.text.BadLocationException, java.io.IOException
emptyTag
in class javax.swing.text.html.HTMLWriter
elem
- an Element
java.io.IOException
- on any I/O error
javax.swing.text.BadLocationException
- if pos represents an invalid
location within the document.protected boolean isBlockTag(javax.swing.text.AttributeSet attr)
isBlockTag
in class javax.swing.text.html.HTMLWriter
attr
- an AttributeSet
protected void startTag(javax.swing.text.Element elem) throws java.io.IOException, javax.swing.text.BadLocationException
startTag
in class javax.swing.text.html.HTMLWriter
elem
- an Element
java.io.IOException
- on any I/O error
javax.swing.text.BadLocationException
protected void textAreaContent(javax.swing.text.AttributeSet attr) throws javax.swing.text.BadLocationException, java.io.IOException
textAreaContent
in class javax.swing.text.html.HTMLWriter
attr
- an AttributeSet
java.io.IOException
- on any I/O error
javax.swing.text.BadLocationException
- if pos represents an invalid
location within the document.protected void text(javax.swing.text.Element elem) throws javax.swing.text.BadLocationException, java.io.IOException
text
in class javax.swing.text.html.HTMLWriter
elem
- an Element
java.io.IOException
- on any I/O error
javax.swing.text.BadLocationException
- if pos represents an invalid
location within the document.protected void selectContent(javax.swing.text.AttributeSet attr) throws java.io.IOException
selectContent
in class javax.swing.text.html.HTMLWriter
attr
- the AttributeSet associated with the form element
java.io.IOException
- on any I/O errorprotected void writeOption(javax.swing.text.html.Option option) throws java.io.IOException
writeOption
in class javax.swing.text.html.HTMLWriter
option
- an Option
java.io.IOException
- on any I/O errorprotected void endTag(javax.swing.text.Element elem) throws java.io.IOException
endTag
in class javax.swing.text.html.HTMLWriter
elem
- an Element
java.io.IOException
- on any I/O errorprotected void comment(javax.swing.text.Element elem) throws javax.swing.text.BadLocationException, java.io.IOException
comment
in class javax.swing.text.html.HTMLWriter
elem
- an Element
java.io.IOException
- on any I/O error
javax.swing.text.BadLocationException
- if pos represents an invalid
location within the document.protected boolean synthesizedElement(javax.swing.text.Element elem)
synthesizedElement
in class javax.swing.text.html.HTMLWriter
protected boolean matchNameAttribute(javax.swing.text.AttributeSet attr, javax.swing.text.html.HTML.Tag tag)
matchNameAttribute
in class javax.swing.text.html.HTMLWriter
protected void writeEmbeddedTags(javax.swing.text.AttributeSet attr) throws java.io.IOException
writeEmbeddedTags
in class javax.swing.text.html.HTMLWriter
java.io.IOException
- on any I/O errorprotected void closeOutUnwantedEmbeddedTags(javax.swing.text.AttributeSet attr) throws java.io.IOException
closeOutUnwantedEmbeddedTags
in class javax.swing.text.html.HTMLWriter
java.io.IOException
- on any I/O errorprotected void writeLineSeparator() throws java.io.IOException
writeLineSeparator
in class javax.swing.text.html.HTMLWriter
java.io.IOException
protected void output(char[] chars, int start, int length) throws java.io.IOException
super.output
will be invoked to
write the content.
output
in class javax.swing.text.html.HTMLWriter
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |