Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Ryall2010-12-16 17:46:30 +0000
committerKen Ryall2010-12-16 17:46:30 +0000
commitd1c831f3c23c2d22491074238a268db229027a4e (patch)
tree47b3e43c05175ca8079379c8d575da89c6d008f6 /launch/org.eclipse.cdt.launch
parentd9d0cd6f1791a24155817341b8b49c1e316a7772 (diff)
downloadorg.eclipse.cdt-d1c831f3c23c2d22491074238a268db229027a4e.tar.gz
org.eclipse.cdt-d1c831f3c23c2d22491074238a268db229027a4e.tar.xz
org.eclipse.cdt-d1c831f3c23c2d22491074238a268db229027a4e.zip
Enhance support for scripting and running headless.
Diffstat (limited to 'launch/org.eclipse.cdt.launch')
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/LaunchUtils.java32
1 files changed, 17 insertions, 15 deletions
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/LaunchUtils.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/LaunchUtils.java
index 791139ad44..8569df84fd 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/LaunchUtils.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/LaunchUtils.java
@@ -134,21 +134,23 @@ public class LaunchUtils {
@SuppressWarnings("unchecked")
public static void enableActivity(final String activityID, final boolean enableit)
{
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
- public void run() {
- IWorkbenchActivitySupport workbenchActivitySupport = PlatformUI.getWorkbench().getActivitySupport();
- IActivityManager activityManager = workbenchActivitySupport.getActivityManager();
- Set<String> enabledActivityIds = new HashSet<String>(activityManager.getEnabledActivityIds());
- boolean changed = false;
- if (enableit)
- changed = enabledActivityIds.add(activityID);
- else
- changed = enabledActivityIds.remove(activityID);
- if (changed)
- workbenchActivitySupport.setEnabledActivityIds(enabledActivityIds);
- }
- });
-
+ if (PlatformUI.isWorkbenchRunning())
+ {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ IWorkbenchActivitySupport workbenchActivitySupport = PlatformUI.getWorkbench().getActivitySupport();
+ IActivityManager activityManager = workbenchActivitySupport.getActivityManager();
+ Set<String> enabledActivityIds = new HashSet<String>(activityManager.getEnabledActivityIds());
+ boolean changed = false;
+ if (enableit)
+ changed = enabledActivityIds.add(activityID);
+ else
+ changed = enabledActivityIds.remove(activityID);
+ if (changed)
+ workbenchActivitySupport.setEnabledActivityIds(enabledActivityIds);
+ }
+ });
+ }
}
/**

Back to the top