public class TextAreaWriter
extends java.io.Writer
Modifier and Type | Field and Description |
---|---|
static int |
DEF_MAXNL_SEARCH
Max # of chars to search for newline after trim (400).
|
static int |
DEF_TEXTSIZE_LIMIT
Default text size limit, in characters (8000000).
|
static int |
DEF_TEXTTRIM_SIZE
Number of characters to trim when over limit (8000).
|
Constructor and Description |
---|
TextAreaWriter(javax.swing.JTextArea textAreaObj)
Creates an 'Writer' extension that sends its output to a
'TextArea' object.
|
TextAreaWriter(javax.swing.JTextArea textAreaObj,
boolean setupTextObjFlag)
Creates an 'Writer' extension that sends its output to a
'TextArea' object.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the stream; does nothing in this implementation.
|
void |
doSetupTextAreaObj()
Sets up the text area object to be not-editable while still having
a visible caret and text cursor.
|
void |
doWrite(char[] charsArr,
int offsetVal,
int numChars)
Sends a portion of an array of characters to the text area.
|
void |
flush()
Flushes the stream; does nothing in this implementation.
|
int |
getMaxNewLineSearch()
Returns the text size limit.
|
int |
getTextSizeLimit()
Returns the maximum number of characters to search for a newline
after a trim.
|
int |
getTextTrimSize()
Returns the text trim size.
|
void |
setTextSizeLimitValues(int textSizeLimit,
int textTrimSize)
Sets the text size limit values.
|
void |
setTextSizeLimitValues(int textSizeLimit,
int textTrimSize,
int maxNewLineSearch)
Sets the text size limit values.
|
void |
setupTextAreaObj()
Sets up the text area object to be not-editable while still having
a visible caret and text cursor.
|
void |
write(char[] charsArr,
int offsetVal,
int numChars)
Sends a portion of an array of characters to the text area.
|
public static final int DEF_TEXTSIZE_LIMIT
public static final int DEF_TEXTTRIM_SIZE
public static final int DEF_MAXNL_SEARCH
public TextAreaWriter(javax.swing.JTextArea textAreaObj)
textAreaObj
- 'TextArea' objectpublic TextAreaWriter(javax.swing.JTextArea textAreaObj, boolean setupTextObjFlag)
textAreaObj
- 'TextArea' objectsetupTextObjFlag
- if true then 'setupTextAreaObj()' is
called to setup the given text area object.public void setupTextAreaObj()
public void doSetupTextAreaObj()
public void write(char[] charsArr, int offsetVal, int numChars) throws java.io.IOException
write
in class java.io.Writer
charsArr
- array of characters.offsetVal
- offset from which to start writing characters.numChars
- number of characters to write.java.io.IOException
- if an I/O error occurs.public void doWrite(char[] charsArr, int offsetVal, int numChars) throws java.io.IOException
charsArr
- array of characters.offsetVal
- offset from which to start writing characters.numChars
- number of characters to write.java.io.IOException
- if an I/O error occurs.public void flush()
flush
in interface java.io.Flushable
flush
in class java.io.Writer
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.Writer
public void setTextSizeLimitValues(int textSizeLimit, int textTrimSize, int maxNewLineSearch)
textSizeLimit
- text size limit, in characters.textTrimSize
- number of character to trim when over limit.maxNewLineSearch
- maximum number of characters to search for
a newline after a trim, or 0 or no search.public void setTextSizeLimitValues(int textSizeLimit, int textTrimSize)
textSizeLimit
- text size limit, in characters.textTrimSize
- number of character to trim when over limit.public int getTextTrimSize()
public int getMaxNewLineSearch()
public int getTextSizeLimit()