[139413] headless UI fix
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/UITesterImpl.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/UITesterImpl.java
index bbbdf25..7d19f90 100644
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/UITesterImpl.java
+++ b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/UITesterImpl.java
@@ -17,6 +17,7 @@
package org.eclipse.wst.common.frameworks.internal.ui;
import org.eclipse.jem.util.UITester;
+import org.eclipse.ui.PlatformUI;
/**
@@ -40,14 +41,13 @@
* @see org.eclipse.wst.common.frameworks.internal.UITester#isCurrentContextUI()
*/
public boolean isCurrentContextUI() {
- // Because this is contributed by the UI plugin return true for now regardless of the state of the PlatformUI
- return true;
-// try {
-// return PlatformUI.isWorkbenchRunning() || PlatformUI.getWorkbench().isClosing();
-// } catch (RuntimeException e) {
-// e.printStackTrace();
-// return false;
-// }
+ //TODO verify this is working properly now
+ try {
+ return PlatformUI.isWorkbenchRunning() || PlatformUI.getWorkbench().isClosing();
+ } catch (Exception e) {
+ //Ignore, workbench must not be running
+ return false;
+ }
}
}