From 8f3205ab4f86a6822b1e8f05e204b5927a0a5ceb Mon Sep 17 00:00:00 2001 From: Roger Ferrel Date: Thu, 4 Oct 2012 11:49:29 -0500 Subject: [PATCH] Issue #1229 Changes for non-blocking ClimateDataMenuDlg. Change-Id: I4995c135140b89aa040a29266ff04840ed172084 Former-commit-id: e83e6e4348dbf96256ab3a6fa17800f65ab8b4e4 [formerly 2b23f4a4ac2b9b42d07ac23e20f3cccba25edc0d [formerly 238961a288d30d70b2661a7441852ca5df3d41b9]] Former-commit-id: 2b23f4a4ac2b9b42d07ac23e20f3cccba25edc0d Former-commit-id: bb552bcaf63f089a025316989ec4e11d2da19df2 --- .../src/com/raytheon/viz/aviation/AvnconfigDlg.java | 7 +++++-- .../viz/aviation/climatedata/ClimateDataMenuDlg.java | 10 ++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/AvnconfigDlg.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/AvnconfigDlg.java index fb317c28f6..44bd35e463 100644 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/AvnconfigDlg.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/AvnconfigDlg.java @@ -54,6 +54,7 @@ import com.raytheon.viz.avnconfig.TextEditorSetupDlg; * ------------ ---------- ----------- -------------------------- * 22 MAY 2008 1119 lvenable Initial creation * 01 OCT 2010 4345 rferrel Bring existing dialog to the front. + * 04 OCT 2012 1229 rferrel Work with non-blocking ClimateDataMenuDlg. * * * @@ -366,10 +367,12 @@ public class AvnconfigDlg extends Dialog { climateBtn.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent event) { - if (climateDataDlg == null) { + if (climateDataDlg == null || climateDataDlg.getShell() == null + || climateDataDlg.isDisposed()) { climateDataDlg = new ClimateDataMenuDlg(shell); climateDataDlg.open(); - climateDataDlg = null; + } else { + climateDataDlg.bringToTop(); } } }); diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/climatedata/ClimateDataMenuDlg.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/climatedata/ClimateDataMenuDlg.java index 04a190f267..98bfce70bb 100644 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/climatedata/ClimateDataMenuDlg.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/climatedata/ClimateDataMenuDlg.java @@ -91,6 +91,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog; * Mar 18, 2011 #8681 rferrel Corrected checkSite to prevent exception. * May 24, 2011 #9075 rferrel Changed getObsHistoryFromInv() to scan * ish-inventory.txt only one time. + * Oct 04, 2012 #1229 rferrel Made non-blocking. * * * @@ -229,7 +230,8 @@ public class ClimateDataMenuDlg extends CaveSWTDialog { * Parent shell. */ public ClimateDataMenuDlg(Shell parentShell) { - super(parentShell, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT); + super(parentShell, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT + | CAVE.DO_NOT_BLOCK); setText("AvnFPS Climate Data Menu"); } @@ -881,11 +883,11 @@ public class ClimateDataMenuDlg extends CaveSWTDialog { identList.add(siteList.get(i)); } } catch (IOException e) { - statusHandler.handle(Priority.PROBLEM, e.getMessage()); + statusHandler.handle(Priority.PROBLEM, e.getMessage()); } catch (ConfigurationException e) { - statusHandler.handle(Priority.PROBLEM, e.toString()); + statusHandler.handle(Priority.PROBLEM, e.toString()); } catch (LocalizationOpFailedException e) { - statusHandler.handle(Priority.PROBLEM, e.getMessage()); + statusHandler.handle(Priority.PROBLEM, e.getMessage()); } }