From 22fbf6625ad950670e5dcd74fe467d3a5fd9bc14 Mon Sep 17 00:00:00 2001 From: James Korman Date: Thu, 11 Oct 2012 09:10:41 -0500 Subject: [PATCH] Issue #1229 - Change to use non-blocking. Change-Id: I9989b5b37e39a553434d4c104bfe9577925a6bd7 Former-commit-id: 7569aac1ea75f54d143b4874ca15c4d9351f68a8 [formerly d256be698055ec39d465b5784ff80d4872ae6d64] [formerly 7569aac1ea75f54d143b4874ca15c4d9351f68a8 [formerly d256be698055ec39d465b5784ff80d4872ae6d64] [formerly cdbf9085f5cc2a1b7f30e4287df095572e218614 [formerly b68db18e4d20db986844bf3fdb44d74f31308539]]] Former-commit-id: cdbf9085f5cc2a1b7f30e4287df095572e218614 Former-commit-id: 26e22665c21103fd44f395011e4ca5bfca77eb6f [formerly 12ba9d630f4ac1f59f0c1fdf5dadecd8b875bcdf] Former-commit-id: 4511b4141a26cb10acb1f8eb0e94375d0c0e91f7 --- .../viz/aviation/observer/TafMonitorDlg.java | 18 +++++++++++++++--- .../viz/aviation/utility/AlertDialog.java | 3 ++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/observer/TafMonitorDlg.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/observer/TafMonitorDlg.java index b21c162549..7510cb1afc 100644 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/observer/TafMonitorDlg.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/observer/TafMonitorDlg.java @@ -135,7 +135,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback; * 10/09/2012 1229 rferrel Made dialog non-blocking. * 10/10/2012 1229 rferrel Changes for non-blocking ResourceEditorDlg. * 10/10/2012 1229 rferrel Changes for non-blocking TransmissionQueueDlg. - * + * 10/10/2012 1229 jkorman Changes for AlertDialog to support non-blocking. * * * @author grichard @@ -193,6 +193,11 @@ public class TafMonitorDlg extends CaveSWTDialog { */ private ResourceEditorDlg resDlg; + /** + * Alert configuration dialog. + */ + private AlertDialog alertDialog; + /** * Resource configuration manager. */ @@ -508,8 +513,15 @@ public class TafMonitorDlg extends CaveSWTDialog { alertMenuItem.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent event) { - AlertDialog alertDialog = new AlertDialog(shell); - alertDialog.open(); + // Do we need to create a new dialog? + if ((alertDialog == null) || (alertDialog.getShell() == null) + || (alertDialog.isDisposed())) { + alertDialog = new AlertDialog(shell); + alertDialog.open(); + } else { + // No, so use the existing dialog. + alertDialog.bringToTop(); + } } }); diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/utility/AlertDialog.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/utility/AlertDialog.java index 874b07a233..a41b60a850 100644 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/utility/AlertDialog.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/utility/AlertDialog.java @@ -45,6 +45,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 1/24/2008 817 grichard Initial creation. + * 20121010 1229 jkorman Added DO_NOT_BLOCK so dialog does not block on open. * * * @@ -72,7 +73,7 @@ public class AlertDialog extends CaveSWTDialog { * Parent Shell. */ public AlertDialog(Shell parent) { - super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT); + super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT | CAVE.DO_NOT_BLOCK); setText("AvnFPS Alert Dialog"); }