Author: snjeza
Date: 2012-03-22 15:38:04 -0400 (Thu, 22 Mar 2012)
New Revision: 39777
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/FeedsToolTip.java
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/ToolTip.java
Log:
JBIDE-10938 - tooltips fail in wizard examples
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 2012-03-22
16:38:11 UTC (rev 39776)
+++
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java 2012-03-22
19:38:04 UTC (rev 39777)
@@ -195,7 +195,7 @@
}
}
- public static void log(Exception e, String message) {
+ public static void log(Throwable e, String message) {
IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, message, e);
plugin.getLog().log(status);
}
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/FeedsToolTip.java
===================================================================
---
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/FeedsToolTip.java 2012-03-22
16:38:11 UTC (rev 39776)
+++
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/FeedsToolTip.java 2012-03-22
19:38:04 UTC (rev 39777)
@@ -11,7 +11,6 @@
package org.jboss.tools.central.editors;
-import org.eclipse.jface.window.ToolTip;
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.browser.LocationAdapter;
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 2012-03-22
16:38:11 UTC (rev 39776)
+++
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2012-03-22
19:38:04 UTC (rev 39777)
@@ -46,7 +46,6 @@
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.window.ToolTip;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.BusyIndicator;
@@ -925,7 +924,7 @@
displayTutorialLinks(categories.get(category), composite, true);
categoryComposite.setClient(composite);
String description = category.getDescription();
- if (description != null && !description.isEmpty() &&
categoryComposite.getControl() != null) {
+ if (description != null && !description.isEmpty() &&
categoryComposite.getControl() != null &&
!categoryComposite.getControl().isDisposed()) {
final DescriptionToolTip toolTip = new
DescriptionToolTip(categoryComposite.getControl(), description);
toolTip.activate();
}
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/ToolTip.java
===================================================================
---
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/ToolTip.java 2012-03-22
16:38:11 UTC (rev 39776)
+++
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/ToolTip.java 2012-03-22
19:38:04 UTC (rev 39777)
@@ -16,6 +16,7 @@
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Monitor;
import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.central.JBossCentralActivator;
/**
* This class gives implementors to provide customized tooltips for any control.
@@ -434,8 +435,13 @@
private void toolTipHide(Shell tip, Event event) {
if (tip != null && !tip.isDisposed() && shouldHideToolTip(event)) {
- if (!control.getShell().isDisposed()) {
- control.getShell().removeListener(SWT.Deactivate, shellListener);
+ try {
+ if (control != null && !control.isDisposed() &&
!control.getShell().isDisposed()) {
+ control.getShell().removeListener(SWT.Deactivate, shellListener);
+ }
+ } catch (Throwable t) {
+ // workaround for
https://issues.jboss.org/browse/JBIDE-10938/https://issues.jboss.org/brow...
+ JBossCentralActivator.log(t,
"https://issues.jboss.org/browse/JBIDE-10938");
}
currentArea = null;
passOnEvent(tip, event);