mirror of
https://github.com/processing/processing4.git
synced 2026-01-28 02:41:08 +01:00
Change Editor status message only from EDT
This adapter invokes all status changes on the EDT instead of worker thread of the Runner. Modifying AWT components from the worker threads may introduce strange bugs and in this case caused UI changes to run out of order, hiding runtime exceptions under problems displayed when cursor moves to the offending line.
This commit is contained in:
@@ -39,6 +39,7 @@ import javax.swing.JTree; // needed for javadocs
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
|
||||
import processing.app.Messages;
|
||||
import processing.app.RunnerListenerEdtAdapter;
|
||||
import processing.app.Sketch;
|
||||
import processing.app.SketchCode;
|
||||
import processing.mode.java.debug.*;
|
||||
@@ -201,7 +202,7 @@ public class Debugger {
|
||||
//lineMap = LineMapping.generateMapping(srcPath + File.separator + mainClassName + ".java");
|
||||
|
||||
log("launching debuggee runtime");
|
||||
runtime = new Runner(build, editor);
|
||||
runtime = new Runner(build, new RunnerListenerEdtAdapter(editor));
|
||||
VirtualMachine vm = runtime.debug(null); // non-blocking
|
||||
if (vm == null) {
|
||||
loge("error 37: launch failed", null);
|
||||
|
||||
@@ -1093,10 +1093,11 @@ public class JavaEditor extends Editor {
|
||||
synchronized (runtimeLock) {
|
||||
if (runtimeLaunchRequested) {
|
||||
runtimeLaunchRequested = false;
|
||||
RunnerListener listener = new RunnerListenerEdtAdapter(JavaEditor.this);
|
||||
if (!tweak) {
|
||||
runtime = jmode.handleLaunch(sketch, JavaEditor.this, present);
|
||||
runtime = jmode.handleLaunch(sketch, listener, present);
|
||||
} else {
|
||||
runtime = jmode.handleTweak(sketch, JavaEditor.this);
|
||||
runtime = jmode.handleTweak(sketch, listener);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user