Methods Summary |
---|
public void | addPropertyChangeListener(UIPropertyChangeListener l)
if (useFile) {
if (pw != null) {
try {
file_mon.enter();
pw.close();
pw = null;
} finally {
file_mon.exit();
}
}
useFile = false;
setText(getFileText());
}
super.addPropertyChangeListener(l);
|
public void | appendText(java.lang.String text)
if (useFile && pw != null) {
try {
file_mon.enter();
pw.print(text);
pw.flush();
return;
} finally {
file_mon.exit();
}
}
synchronized( this ){
delay_text.addLast( text );
delay_size += text.length();
while( delay_size > max_size ){
if ( delay_text.size() == 0 ){
break;
}
String s = (String)delay_text.removeFirst();
delay_size -= s.length();
}
}
dispatcher.dispatch();
|
protected void | delayAppend()
String str = getText();
String text;
synchronized( this ){
if ( delay_text.size() == 1 ){
text = (String)delay_text.get(0);
}else{
StringBuffer sb = new StringBuffer( delay_size );
Iterator it = delay_text.iterator();
while( it.hasNext()){
sb.append((String)it.next());
}
text = sb.toString();
}
delay_text.clear();
delay_size = 0;
}
if ( str == null ){
setText( text );
}else{
setText( str + text );
}
|
private java.lang.String | getFileText()
boolean recreate = pw != null;
try {
file_mon.enter();
if (recreate) {
pw.close();
}
String text = null;
try {
text = FileUtil.readFileEndAsString(file, max_size);
} catch (IOException e) {
e.printStackTrace();
}
if (text == null) {
text = "";
}
if (recreate) {
try {
FileWriter fr = new FileWriter(file, true);
pw = new PrintWriter(fr);
} catch (IOException e) {
useFile = false;
e.printStackTrace();
}
}
return text;
} finally {
file_mon.exit();
}
|
public java.lang.String | getText()
if (useFile && pw != null) {
return getFileText();
}
return((String)getProperty( PT_VALUE ));
|
public void | setMaximumSize(int _max_size)
max_size = _max_size;
|
public void | setText(java.lang.String text)
if (useFile) {
try {
file_mon.enter();
if (pw == null) {
try {
file = AETemporaryFileHandler.createTempFile();
FileWriter fr = new FileWriter(file);
pw = new PrintWriter(fr);
pw.print(text);
pw.flush();
return;
} catch (IOException e) {
}
}
} finally {
file_mon.exit();
}
}
// has property change listener, or error while doing file (fallthrough)
if ( text.length() > max_size ){
int size_to_show = max_size - 10000;
if ( size_to_show < 0 ){
size_to_show = max_size;
}
text = text.substring( text.length() - size_to_show );
}
setProperty( PT_VALUE, text );
|