Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Rennie2008-12-08 14:39:30 -0500
committerMichael Rennie2008-12-08 14:39:30 -0500
commiteac7c9f1d35c0645e2cb62bca36fe9fd7c68ca24 (patch)
tree2b5759c68c6966dce3d80a099ea9c9666091bfb0 /org.eclipse.ui.console
parent7efa00267016f7c32c26c6f57cf42f0fd21f1b82 (diff)
downloadeclipse.platform.debug-eac7c9f1d35c0645e2cb62bca36fe9fd7c68ca24.tar.gz
eclipse.platform.debug-eac7c9f1d35c0645e2cb62bca36fe9fd7c68ca24.tar.xz
eclipse.platform.debug-eac7c9f1d35c0645e2cb62bca36fe9fd7c68ca24.zip
Bug 257970 SWT Exception shutting down Eclipse
Diffstat (limited to 'org.eclipse.ui.console')
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDropDownAction.java30
1 files changed, 20 insertions, 10 deletions
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDropDownAction.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDropDownAction.java
index 6af6354d8..ab3b388ee 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDropDownAction.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDropDownAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,11 +13,14 @@ package org.eclipse.ui.internal.console;
import java.util.List;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IMenuCreator;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.console.ConsolePlugin;
@@ -25,6 +28,7 @@ import org.eclipse.ui.console.IConsole;
import org.eclipse.ui.console.IConsoleConstants;
import org.eclipse.ui.console.IConsoleListener;
import org.eclipse.ui.console.IConsoleView;
+import org.eclipse.ui.progress.UIJob;
import org.eclipse.ui.texteditor.IUpdate;
/**
@@ -130,12 +134,15 @@ class ConsoleDropDownAction extends Action implements IMenuCreator, IConsoleList
* @see org.eclipse.ui.console.IConsoleListener#consolesAdded(org.eclipse.ui.console.IConsole[])
*/
public void consolesAdded(IConsole[] consoles) {
- Display display = ConsolePlugin.getStandardDisplay();
- display.asyncExec(new Runnable() {
- public void run() {
+ UIJob job = new UIJob("") { //$NON-NLS-1$
+ public IStatus runInUIThread(IProgressMonitor monitor) {
update();
+ return Status.OK_STATUS;
}
- });
+ };
+ job.setSystem(true);
+ job.setPriority(Job.INTERACTIVE);
+ job.schedule();
}
/* (non-Javadoc)
@@ -146,14 +153,17 @@ class ConsoleDropDownAction extends Action implements IMenuCreator, IConsoleList
* @see org.eclipse.ui.console.IConsoleListener#consolesRemoved(org.eclipse.ui.console.IConsole[])
*/
public void consolesRemoved(IConsole[] consoles) {
- Display display = ConsolePlugin.getStandardDisplay();
- display.asyncExec(new Runnable() {
- public void run() {
+ UIJob job = new UIJob("") { //$NON-NLS-1$
+ public IStatus runInUIThread(IProgressMonitor monitor) {
if (fMenu != null) {
fMenu.dispose();
}
update();
+ return Status.OK_STATUS;
}
- });
+ };
+ job.setSystem(true);
+ job.setPriority(Job.INTERACTIVE);
+ job.schedule();
}
}

Back to the top