Author: snjeza
Date: 2011-10-20 13:58:33 -0400 (Thu, 20 Oct 2011)
New Revision: 35856
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
Log:
JBIDE-9976 Tooltips in JBoss Central crash in Windows 7 64bits
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java
===================================================================
---
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java 2011-10-20
17:55:43 UTC (rev 35855)
+++
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java 2011-10-20
17:58:33 UTC (rev 35856)
@@ -31,6 +31,8 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorInput;
@@ -132,6 +134,8 @@
// The shared instance
private static JBossCentralActivator plugin;
+ private static Boolean isInternalWebBrowserAvailable;
+
/**
* The constructor
*/
@@ -436,4 +440,29 @@
}
return directory;
}
+
+ public static boolean isInternalWebBrowserAvailable() {
+ if (isInternalWebBrowserAvailable != null) {
+ return isInternalWebBrowserAvailable.booleanValue();
+ }
+ Shell shell = null;
+ try {
+ shell = new Shell(PlatformUI.getWorkbench().getDisplay());
+ new Browser(shell, SWT.NONE);
+ isInternalWebBrowserAvailable = new Boolean(true);
+ return true;
+ } catch (Throwable t) {
+ try {
+ new Browser(shell, SWT.WEBKIT);
+ isInternalWebBrowserAvailable = new Boolean(true);
+ return true;
+ } catch (Throwable e) {
+ isInternalWebBrowserAvailable = new Boolean(false);
+ return false;
+ }
+ } finally {
+ if (shell != null)
+ shell.dispose();
+ }
+ }
}
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
===================================================================
---
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-10-20
17:55:43 UTC (rev 35855)
+++
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-10-20
17:58:33 UTC (rev 35856)
@@ -941,7 +941,7 @@
//formText.setFont("author", boldFont);
formText.setColor("author", JFaceColors.getHyperlinkText(getDisplay()));
formText.setImage("image", getFeedsImage());
- if (entry.getDescription() != null && !entry.getDescription().isEmpty()) {
+ if (JBossCentralActivator.isInternalWebBrowserAvailable() &&
entry.getDescription() != null && !entry.getDescription().isEmpty()) {
ToolTip toolTip = new FeedsToolTip(formText, entry.getDate() + " " +
entry.getDescription());
toolTip.activate();
}
Show replies by date