From 1b74b2d4a4a26160cf7007c30904423ad2646ae2 Mon Sep 17 00:00:00 2001 From: Roger Ferrel Date: Wed, 27 Mar 2013 16:56:17 -0500 Subject: [PATCH] Issue #1790 Bug fixes for ticket 1353. Change-Id: I36b74546b7f73c669d65a5588e813173ccbd18fc Former-commit-id: 04b57a8582596a529c2ae853bd72e10c7c8bdc87 [formerly 04b57a8582596a529c2ae853bd72e10c7c8bdc87 [formerly e0c3e3b81f679985a048047b3e5aa69992577d78]] Former-commit-id: 391ce5687bdd3abf156004acf11fb835de4272dc Former-commit-id: 726b5de0c5c54f5b6cf0d02ef231577114b271d9 --- .../hydro/alertalarm/AlertAlarmValuesAction.java | 7 +++++-- .../hydro/appsdefaults/AppsDefaultsAction.java | 15 ++++++++++----- .../bestestimateqpe/BestEstimateQpeAction.java | 9 ++++++--- .../viz/hydro/damdisplay/DamDisplayAction.java | 7 +++++-- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/alertalarm/AlertAlarmValuesAction.java b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/alertalarm/AlertAlarmValuesAction.java index e9a2f4dc1c..84a1aeebc9 100644 --- a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/alertalarm/AlertAlarmValuesAction.java +++ b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/alertalarm/AlertAlarmValuesAction.java @@ -37,6 +37,7 @@ import org.eclipse.ui.PlatformUI; * ------------ ---------- ----------- -------------------------- * 6/27/07 lvenable Initial creation. * 12/05/12 1353 rferrel Changes for non-blocking AlertAlarmValuesDlg. + * 03/27/2013 1790 rferrel Bug fix for non-blocking dialogs. * * * @@ -49,12 +50,14 @@ public class AlertAlarmValuesAction extends AbstractHandler { @Override public Object execute(ExecutionEvent arg0) throws ExecutionException { - if (alertAlarmDlg == null) { + if (alertAlarmDlg == null || alertAlarmDlg.isDisposed()) { Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow() .getShell(); alertAlarmDlg = new AlertAlarmValuesDlg(shell); + alertAlarmDlg.open(); + } else { + alertAlarmDlg.bringToTop(); } - alertAlarmDlg.open(); return null; } diff --git a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/appsdefaults/AppsDefaultsAction.java b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/appsdefaults/AppsDefaultsAction.java index 9b198d89b4..7aa812aaa0 100644 --- a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/appsdefaults/AppsDefaultsAction.java +++ b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/appsdefaults/AppsDefaultsAction.java @@ -26,7 +26,7 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.PlatformUI; /** - * TODO Add Description + * Action to display the Get Apps Defaults or SHEF Apps Defaults dialog. * *
  * 
@@ -37,6 +37,7 @@ import org.eclipse.ui.PlatformUI;
  * Jan 26, 2011            mpduff     Initial creation
  * Dec 06, 2012 1353       rferrel     Changes for non blocking GetAppsDefaults.
  *                                      Changes for non blocking SHEFAppsDefaultsDlg.
+ * Mar 27, 2013 1790       rferrel     Bug fix for non-blocking dialogs.
  * 
  * 
* @@ -62,15 +63,19 @@ public class AppsDefaultsAction extends AbstractHandler { .getShell(); String action = event.getParameter("Action"); if (action.equals("gad")) { - if (gad == null) { + if (gad == null || gad.isDisposed()) { gad = new GetAppsDefaults(shell); + gad.open(); + } else { + gad.bringToTop(); } - gad.open(); } else { - if (dlg == null) { + if (dlg == null || dlg.isDisposed()) { dlg = new SHEFAppsDefaultsDlg(shell); + dlg.open(); + } else { + dlg.bringToTop(); } - dlg.open(); } return null; } diff --git a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/bestestimateqpe/BestEstimateQpeAction.java b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/bestestimateqpe/BestEstimateQpeAction.java index 37393eb226..244328af26 100644 --- a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/bestestimateqpe/BestEstimateQpeAction.java +++ b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/bestestimateqpe/BestEstimateQpeAction.java @@ -40,7 +40,8 @@ import org.eclipse.ui.PlatformUI; * ------------ ---------- ----------- -------------------------- * 6/27/06 randerso Initial Creation. * 8/24/2009 2258 mpduff Removed not implemented message. - * 12/05/1212 1363 rferrel Changes for non-blocking BestEstimateQpeDlg. + * 12/05/2012 1363 rferrel Changes for non-blocking BestEstimateQpeDlg. + * 03/27/2013 1790 rferrel Bug fix for non-blocking dialogs. * * * @@ -52,12 +53,14 @@ public class BestEstimateQpeAction extends AbstractHandler { @Override public Object execute(ExecutionEvent arg0) throws ExecutionException { - if (bestEstimateDlg == null) { + if (bestEstimateDlg == null || bestEstimateDlg.isDisposed()) { Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow() .getShell(); bestEstimateDlg = new BestEstimateQpeDlg(shell); + bestEstimateDlg.open(); + } else { + bestEstimateDlg.bringToTop(); } - bestEstimateDlg.open(); return null; } diff --git a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/damdisplay/DamDisplayAction.java b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/damdisplay/DamDisplayAction.java index 46f785216e..7591b1f8f9 100644 --- a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/damdisplay/DamDisplayAction.java +++ b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/damdisplay/DamDisplayAction.java @@ -40,6 +40,7 @@ import org.eclipse.ui.PlatformUI; * ------------ ---------- ----------- -------------------------- * 6/27/06 randerso Initial Creation. * 12/10/2013 1353 rferrel Changes for non-blocking DamDisplayControlDlg. + * 03/27/2013 1790 rferrel Bug fix for non-blocking dialogs. * * * @@ -58,12 +59,14 @@ public class DamDisplayAction extends AbstractHandler { */ @Override public Object execute(ExecutionEvent arg0) throws ExecutionException { - if (damDisplayDlg == null) { + if (damDisplayDlg == null || damDisplayDlg.isDisposed()) { Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow() .getShell(); damDisplayDlg = new DamDisplayControlDlg(shell); + damDisplayDlg.open(); + } else { + damDisplayDlg.bringToTop(); } - damDisplayDlg.open(); return null; }