Author: snjeza
Date: 2011-02-15 17:00:59 -0500 (Tue, 15 Feb 2011)
New Revision: 29164
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeUIActivator.java
Log:
JBIDE-8419 Runtimes aren't visible immediately after adding via JBT Runtime Detection
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeUIActivator.java
===================================================================
---
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeUIActivator.java 2011-02-15
21:46:09 UTC (rev 29163)
+++
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeUIActivator.java 2011-02-15
22:00:59 UTC (rev 29164)
@@ -37,6 +37,7 @@
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
@@ -250,10 +251,16 @@
}
public static void refreshPreferencePage(Shell shell) {
+ Shell mainShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
if (shell != null && !shell.isDisposed()) {
shell.close();
+ } else {
+ shell = Display.getCurrent().getActiveShell();
+ if (shell != mainShell) {
+ shell.close();
+ }
}
- shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ shell = mainShell;
PreferenceDialog preferenceDialog = PreferencesUtil.createPreferenceDialogOn(shell,
RuntimePreferencePage.ID, null, null);
preferenceDialog.open();
}
Show replies by date