From d95b05878404be4391aaca5ec2ef46ef926bc8d3 Mon Sep 17 00:00:00 2001 From: Pawel Piech Date: Tue, 4 Sep 2012 10:04:48 -0700 Subject: Revert "Bug 388238 - NPE when calling DebugUIPlugin.launchInBackground() from non-UI thread" This reverts commit a7933cebb9008430f78cb0a48e66007178723c95. --- .../org/eclipse/debug/internal/ui/DebugUIMessages.java | 1 - .../debug/internal/ui/DebugUIMessages.properties | 1 - .../ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java | 17 +++++------------ 3 files changed, 5 insertions(+), 14 deletions(-) (limited to 'org.eclipse.debug.ui') diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java index 44e4033ab..4f2ad1628 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java @@ -28,7 +28,6 @@ public class DebugUIMessages extends NLS { public static String DebugUIPlugin_0; public static String DebugUIPlugin_25; - public static String DebugUIPlugin_showProgressJob_label; public static String DebugUIPlugin_Build_error__Check_log_for_details__2; public static String DebugUIPlugin_Run_Debug_1; diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties index 4a5060340..8068829d2 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties @@ -14,7 +14,6 @@ DebugUIPlugin_23=Build in Progress DebugUIPlugin_24=Wait for build to finish? DebugUIPlugin_25=Launching {0} -DebugUIPlugin_showProgressJob_label=Show progress for launch DebugUIPlugin_0=\ (waiting for build...) DebugUIPlugin_Build_error__Check_log_for_details__2=Build error. Check log for details. DebugUIPlugin_Run_Debug_1=Run/Debug diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java index ff5e84d84..963cd7551 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java @@ -108,7 +108,6 @@ import org.eclipse.ui.PlatformUI; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.eclipse.ui.progress.IProgressConstants2; import org.eclipse.ui.progress.IProgressService; -import org.eclipse.ui.progress.WorkbenchJob; import org.eclipse.ui.services.IEvaluationService; import org.eclipse.ui.themes.IThemeManager; import org.osgi.framework.Bundle; @@ -1180,7 +1179,7 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener, } } final boolean waitInJob = wait; - final Job job = new Job(MessageFormat.format(DebugUIMessages.DebugUIPlugin_25, new Object[] {configuration.getName()})) { + Job job = new Job(MessageFormat.format(DebugUIMessages.DebugUIPlugin_25, new Object[] {configuration.getName()})) { public IStatus run(final IProgressMonitor monitor) { /* Setup progress monitor * - Waiting for jobs to finish (2) @@ -1247,21 +1246,15 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener, } }; + IWorkbench workbench = DebugUIPlugin.getDefault().getWorkbench(); + IProgressService progressService = workbench.getProgressService(); + job.setPriority(Job.INTERACTIVE); job.setProperty(IProgressConstants2.SHOW_IN_TASKBAR_ICON_PROPERTY, Boolean.TRUE); job.setName(MessageFormat.format(DebugUIMessages.DebugUIPlugin_25, new Object[] {configuration.getName()})); if (wait) { - new WorkbenchJob(DebugUIMessages.DebugUIPlugin_showProgressJob_label) { - { setPriority(INTERACTIVE); } - - public IStatus runInUIThread(IProgressMonitor monitor) { - IWorkbench workbench = DebugUIPlugin.getDefault().getWorkbench(); - IProgressService progressService = workbench.getProgressService(); - progressService.showInDialog(null, job); - return Status.OK_STATUS; - } - }.schedule(); + progressService.showInDialog(workbench.getActiveWorkbenchWindow().getShell(), job); } job.schedule(); } -- cgit v1.2.3