| 
Swing 1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--javax.swing.text.AbstractWriter
AbstractWriter is an abstract class that actually does the work of writing out the element tree including the attributes. In terms of how much is written out per line, the writer defaults to 80. But this value can be set by subclasses.
| Field Summary | |
protected static char | 
NEWLINE
 | 
| Constructor Summary | |
protected  | 
AbstractWriter(Writer w,
               Document doc)
Creates a new AbstractWriter.  | 
protected  | 
AbstractWriter(Writer w,
               Document doc,
               int pos,
               int len)
Creates a new AbstractWriter.  | 
protected  | 
AbstractWriter(Writer w,
               Element root)
Creates a new AbstractWriter.  | 
protected  | 
AbstractWriter(Writer w,
               Element root,
               int pos,
               int len)
Creates a new AbstractWriter.  | 
| Method Summary | |
protected  void | 
decrIndent()
Decrements the indent level.  | 
protected  Document | 
getDocument()
Fetches the document.  | 
protected  ElementIterator | 
getElementIterator()
Fetches the ElementIterator.  | 
protected  String | 
getText(Element elem)
Returns the text associated with the element.  | 
protected  void | 
incrIndent()
Increments the indent level.  | 
protected  void | 
indent()
Does indentation.  | 
protected  boolean | 
inRange(Element next)
This method determines whether the current element is in the range specified.  | 
protected  void | 
setIndentSpace(int space)
Enables subclasses to specify how many spaces an indent maps to.  | 
protected  void | 
setLineLength(int l)
Enables subclasses to set the number of characters they want written per line.  | 
protected  void | 
text(Element elem)
Writes out text.  | 
protected abstract  void | 
write()
This abstract method needs to be implemented by subclasses.  | 
protected  void | 
write(char ch)
Writes out a character.  | 
protected  void | 
write(String str)
Writes out a string.  | 
protected  void | 
writeAttributes(AttributeSet attr)
Writes out the set of attributes as "  | 
| Methods inherited from class java.lang.Object | 
clone, 
equals, 
finalize, 
getClass, 
hashCode, 
notify, 
notifyAll, 
toString, 
wait, 
wait, 
wait | 
| Field Detail | 
protected static final char NEWLINE
| Constructor Detail | 
protected AbstractWriter(Writer w,
                         Document doc)
a - Writer.a - Document
protected AbstractWriter(Writer w,
                         Document doc,
                         int pos,
                         int len)
a - Writeran - Elementpos - The location in the document to fetch the
   content.len - The amount to write out.
protected AbstractWriter(Writer w,
                         Element root)
a - Writeran - Element
protected AbstractWriter(Writer w,
                         Element root,
                         int pos,
                         int len)
a - Writeran - Elementpos - The location in the document to fetch the
   content.len - The amount to write out.| Method Detail | 
protected ElementIterator getElementIterator()
protected Document getDocument()
protected boolean inRange(Element next)
an - Element.
protected abstract void write()
                       throws IOException,
                              BadLocationException
protected String getText(Element elem)
                  throws BadLocationException
an - Element.
protected void text(Element elem)
             throws BadLocationException,
                    IOException
an - Element.protected void setLineLength(int l)
the - maximum line length.protected void setIndentSpace(int space)
an - int representing the space to indent mapping.protected void incrIndent()
protected void decrIndent()
protected void indent()
               throws IOException
protected void write(char ch)
              throws IOException
a - char.
protected void write(String str)
              throws IOException
a - String.
protected void writeAttributes(AttributeSet attr)
                        throws IOException
an - AttributeSet.
  | 
Swing 1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||