summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2011-12-03 19:08:46 (EST)
committerSteffen Pingel2011-12-03 19:08:46 (EST)
commitbcf7ea71a69b399802f1159f92f27a5381c17f19 (patch)
tree37a47c357cd9ba99def30d819d25c22790fd29d5
parentefd18caf6dcbcba0411d450a250601f61b877c07 (diff)
downloadorg.eclipse.mylyn.commons-bcf7ea71a69b399802f1159f92f27a5381c17f19.zip
org.eclipse.mylyn.commons-bcf7ea71a69b399802f1159f92f27a5381c17f19.tar.gz
org.eclipse.mylyn.commons-bcf7ea71a69b399802f1159f92f27a5381c17f19.tar.bz2
NEW - bug 360301: fix failing test
https://bugs.eclipse.org/bugs/show_bug.cgi?id=360301 Change-Id: I838f7561b5580ea9b0f2ddcc703e85e879d2e36e
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/PlatformUiUtil.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/PlatformUiUtil.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/PlatformUiUtil.java
index 20c9cf3..3ee5cbf 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/PlatformUiUtil.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/PlatformUiUtil.java
@@ -19,6 +19,7 @@ import org.eclipse.swt.SWTError;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
import org.osgi.framework.Bundle;
import org.osgi.framework.Version;
@@ -184,9 +185,15 @@ public class PlatformUiUtil {
public static boolean hasInternalBrowser() {
if (internalBrowserAvailable == null) {
try {
- Browser browser = new Browser(Display.getCurrent().getActiveShell(), SWT.NONE);
- browser.dispose();
- internalBrowserAvailable = Boolean.TRUE;
+ Shell[] shells = Display.getDefault().getShells();
+ if (shells.length > 0) {
+ Browser browser = new Browser(shells[0], SWT.NONE);
+ browser.dispose();
+ internalBrowserAvailable = Boolean.TRUE;
+ } else {
+ // can't determine status
+ return false;
+ }
} catch (SWTError er) {
internalBrowserAvailable = Boolean.FALSE;
}