1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 18:56:02 +02:00

build console improvements

This commit is contained in:
David Inglis 2002-11-20 14:16:00 +00:00
parent 22b835c277
commit 83d878c511
2 changed files with 29 additions and 13 deletions

View file

@ -1,3 +1,9 @@
2002-11-20 David Inglis
* src/.../internal/ui/BuildConsoleManager.java
Only flush the console when buffer > 512 instead of every line.
Plus do the console update synchronously as a async update can
cause problems if the update happen faster then the drawing.
2002-11-18 Alain Magloire 2002-11-18 Alain Magloire
* src/.../internal/ui/editor/CEditor.java (createCSourceViewer): * src/.../internal/ui/editor/CEditor.java (createCSourceViewer):

View file

@ -70,20 +70,25 @@ public class BuildConsoleManager implements IBuildConsoleManager, IResourceChang
return fDocument; return fDocument;
} }
public synchronized void flush() throws IOException { public void flush() throws IOException {
super.flush(); flush(false);
Display.getDefault().asyncExec(new Runnable() { }
public void run() {
if (CPluginPreferencePage.isConsoleOnTop()) public void flush(boolean force) throws IOException {
bringConsoleOnTop(); if ( force || fBuffer.length() > 512) {
try { Display.getDefault().syncExec(new Runnable() {
int len = fDocument.getLength(); public void run() {
fDocument.replace(len, 0, readBuffer()); if (CPluginPreferencePage.isConsoleOnTop())
bringConsoleOnTop();
try {
int len = fDocument.getLength();
fDocument.replace(len, 0, readBuffer());
}
catch (BadLocationException x) {
}
} }
catch (BadLocationException x) { });
} }
}
});
} }
void bringConsoleOnTop() { void bringConsoleOnTop() {
@ -111,6 +116,11 @@ public class BuildConsoleManager implements IBuildConsoleManager, IResourceChang
} }
} }
} }
public void close() throws IOException {
flush(true);
}
} }
public BuildConsoleManager() { public BuildConsoleManager() {