aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Gilmer <kgilmer@gmail.com>2011-06-25 13:46:34 +0900
committerKen Gilmer <kgilmer@gmail.com>2011-06-25 13:46:34 +0900
commitde324a5fca37889afba76c0b357ffb7034a67f89 (patch)
tree7a6d09aee2fe91092b46d6b5d97952ff63e7df5b
parentf68857449e861a8c484c2d330a567bd81e5475eb (diff)
downloadeclipsetools-de324a5fca37889afba76c0b357ffb7034a67f89.tar.gz
eclipsetools-de324a5fca37889afba76c0b357ffb7034a67f89.tar.bz2
eclipsetools-de324a5fca37889afba76c0b357ffb7034a67f89.zip
bitbake commander: fix invalid thread access exception.
Change-Id: Ic0e07f91f88fff1ccd27ce88d986062b783b6ca2
-rw-r--r--org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/AbstractBitbakeCommandAction.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/AbstractBitbakeCommandAction.java b/org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/AbstractBitbakeCommandAction.java
index 4e93eee..406c887 100644
--- a/org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/AbstractBitbakeCommandAction.java
+++ b/org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/AbstractBitbakeCommandAction.java
@@ -25,8 +25,10 @@ import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.console.MessageConsole;
import org.eclipse.ui.console.MessageConsoleStream;
import org.openembedded.bc.bitbake.BBLanguageHelper;
@@ -105,11 +107,19 @@ public abstract class AbstractBitbakeCommandAction implements IWorkbenchWindowAc
*/
protected IStatus execCommands(String[] cmds, final IProgressMonitor monitor) {
MessageConsole mc = bbs.getConsole();
- final MessageConsoleStream cmd = mc.newMessageStream();
- cmd.setColor(commandColor);
+ final MessageConsoleStream cmd = mc.newMessageStream();
final MessageConsoleStream out = mc.newMessageStream();
final MessageConsoleStream err = mc.newMessageStream();
- err.setColor(errorColor);
+
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ cmd.setColor(commandColor);
+ err.setColor(errorColor);
+ }
+ });
+
try {
for (int i = 0; i < cmds.length; ++i) {