Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

org.objectweb.cjdbc.console.gui.jtools.JTextAreaWriter Class Reference

List of all members.

Public Member Functions

 JTextAreaWriter (JTextArea textArea)
void setTextArea (JTextArea textArea)
void close ()
void flush () throws IOException
void write (char[] charArray) throws IOException
void write (char[] charArray, int offset, int length) throws IOException
void write (int c) throws IOException
void write (String string) throws IOException
void write (String string, int offset, int length) throws IOException

Detailed Description

A implementation of the java.io.Writer class which provides writing to a JTextArea via a stream.

Author:
Nicolas Modrzyk

Anthony Eden

Definition at line 40 of file JTextAreaWriter.java.


Constructor & Destructor Documentation

org.objectweb.cjdbc.console.gui.jtools.JTextAreaWriter.JTextAreaWriter JTextArea  textArea  ) 
 

Constructor.

Parameters:
textArea The JTextArea to write to.

Definition at line 53 of file JTextAreaWriter.java.

References org.objectweb.cjdbc.console.gui.jtools.JTextAreaWriter.setTextArea().

00054   {
00055     setTextArea(textArea);
00056   }


Member Function Documentation

void org.objectweb.cjdbc.console.gui.jtools.JTextAreaWriter.close  ) 
 

Close the stream.

Definition at line 75 of file JTextAreaWriter.java.

00076   {
00077     closed = true;
00078   }

void org.objectweb.cjdbc.console.gui.jtools.JTextAreaWriter.flush  )  throws IOException
 

Flush the data that is currently in the buffer.

Exceptions:
IOException if fails

Definition at line 86 of file JTextAreaWriter.java.

00087   {
00088     if (closed)
00089     {
00090       throw new IOException("The stream is closed.");
00091     }
00092     textArea.append(getBuffer().toString());
00093     textArea.setCaretPosition(textArea.getDocument().getLength());
00094     buffer = null;
00095   }

void org.objectweb.cjdbc.console.gui.jtools.JTextAreaWriter.setTextArea JTextArea  textArea  ) 
 

Set the JTextArea to write to.

Parameters:
textArea The JTextArea

Definition at line 64 of file JTextAreaWriter.java.

Referenced by org.objectweb.cjdbc.console.gui.jtools.JTextAreaWriter.JTextAreaWriter().

00065   {
00066     if (textArea == null)
00067     {
00068       throw new IllegalArgumentException("The text area must not be null.");
00069     }
00070     this.textArea = textArea;
00071   }

void org.objectweb.cjdbc.console.gui.jtools.JTextAreaWriter.write String  string,
int  offset,
int  length
throws IOException
 

Write the given String to the output stream beginning from the given offset and proceeding to until the given length is reached.

Parameters:
string The String
offset The start offset
length The length to write
Exceptions:
IOException if fails

Definition at line 171 of file JTextAreaWriter.java.

00172   {
00173     if (closed)
00174     {
00175       throw new IOException("The stream is not open.");
00176     }
00177     getBuffer().append(string.substring(offset, length));
00178   }

void org.objectweb.cjdbc.console.gui.jtools.JTextAreaWriter.write String  string  )  throws IOException
 

Write the given String to the output stream.

Parameters:
string The String
Exceptions:
IOException if fails

Definition at line 152 of file JTextAreaWriter.java.

00153   {
00154     if (closed)
00155     {
00156       throw new IOException("The stream is not open.");
00157     }
00158     getBuffer().append(string);
00159   }

void org.objectweb.cjdbc.console.gui.jtools.JTextAreaWriter.write int  c  )  throws IOException
 

Write the given character to the output stream.

Parameters:
c The character
Exceptions:
IOException if fails

Definition at line 136 of file JTextAreaWriter.java.

00137   {
00138     if (closed)
00139     {
00140       throw new IOException("The stream is not open.");
00141     }
00142     getBuffer().append((char) c);
00143   }

void org.objectweb.cjdbc.console.gui.jtools.JTextAreaWriter.write char[]  charArray,
int  offset,
int  length
throws IOException
 

Write the given character array to the output stream beginning from the given offset and proceeding to until the given length is reached.

Parameters:
charArray The character array
offset The start offset
length The length to write
Exceptions:
IOException if fails

Definition at line 119 of file JTextAreaWriter.java.

00121   {
00122     if (closed)
00123     {
00124       throw new IOException("The stream is not open.");
00125     }
00126     getBuffer().append(charArray, offset, length);
00127   }

void org.objectweb.cjdbc.console.gui.jtools.JTextAreaWriter.write char[]  charArray  )  throws IOException
 

Write the given character array to the output stream.

Parameters:
charArray The character array
Exceptions:
IOException if fails

Definition at line 104 of file JTextAreaWriter.java.

00105   {
00106     write(charArray, 0, charArray.length);
00107   }


The documentation for this class was generated from the following file:
Generated on Mon Apr 11 22:02:27 2005 for C-JDBC by  doxygen 1.3.9.1