From b378a542325ad4535f102cad6ba0a4fd65124947 Mon Sep 17 00:00:00 2001 From: Roger Ferrel Date: Mon, 8 Oct 2012 09:56:14 -0500 Subject: [PATCH] Issue #1229 Made AviationDialog blocking when stand along. Change-Id: I3161d45c58cc9504e19af31da21f7f3f4ffd817d Former-commit-id: 00467cddc6cf6f09e6cb939a2278584830896a29 [formerly d6ddafd11deb59d06331e826c1e257a138f2bff0] [formerly 00467cddc6cf6f09e6cb939a2278584830896a29 [formerly d6ddafd11deb59d06331e826c1e257a138f2bff0] [formerly 9c99034be7c2218f9bf76ed8f96c6e6684a798e8 [formerly d23329b3747ccd2659f8e5461cd3c5cde69c1024]]] Former-commit-id: 9c99034be7c2218f9bf76ed8f96c6e6684a798e8 Former-commit-id: 16b51763b82a3085c8acfebfea8de32ca97fd4bb [formerly 0e80705dd4a908f507bed43b5dffe0f7a0491da9] Former-commit-id: 7d95077d703c3a330ea52db7eb1e4a23fc31c2b5 --- .../viz/aviation/AviationComponent.java | 4 +++- .../raytheon/viz/aviation/AviationDialog.java | 19 +++++++++++++++++-- .../textworkstation/TextWorkstationDlg.java | 2 ++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/AviationComponent.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/AviationComponent.java index 33441934e4..9995910c59 100644 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/AviationComponent.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/AviationComponent.java @@ -22,6 +22,7 @@ package com.raytheon.viz.aviation; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; +import com.raytheon.viz.ui.dialogs.CaveSWTDialogBase.CAVE; import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent; /** @@ -35,6 +36,7 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Apr 28, 2011 mschenke Initial creation + * Oct 08, 2012 1229 rferrel Make a blocking dialog. * * * @@ -54,7 +56,7 @@ public class AviationComponent extends AbstractCAVEComponent { @Override protected void startInternal(String componentName) throws Exception { AviationDialog aviationDlg = new AviationDialog(new Shell( - Display.getCurrent())); + Display.getCurrent()), CAVE.NONE); aviationDlg.open(); } diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/AviationDialog.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/AviationDialog.java index d5980a8f4f..96d690a3a4 100644 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/AviationDialog.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/AviationDialog.java @@ -27,6 +27,7 @@ import java.util.concurrent.atomic.AtomicInteger; import javax.xml.bind.JAXB; +import org.eclipse.core.runtime.Assert; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; @@ -173,14 +174,28 @@ public class AviationDialog extends CaveSWTDialog implements IBackupRestart { private final AtomicInteger dlgCount = new AtomicInteger(0); /** - * Constructor. + * Create a non-blocking dialog. * * @param parent * Parent Shell. */ public AviationDialog(Shell parent) { + this(parent, CAVE.DO_NOT_BLOCK); + } + + /** + * Create dialog specifying NONE for blocking and DO_NOT_BLOCK for + * non-blocking dialog. + * + * @param parent + * @param block + * - CAVE.DO_NOT_BLOCK or CAVE.NONE + */ + public AviationDialog(Shell parent, int block) { super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT - | CAVE.INDEPENDENT_SHELL | CAVE.DO_NOT_BLOCK); + | CAVE.INDEPENDENT_SHELL | block); + // Do not allow other CAVE styles to be passed to this constructor. + Assert.isTrue(block == CAVE.DO_NOT_BLOCK || block == CAVE.NONE); setText("AvnFPS Menu"); ForecastModel.getInstance().setBackupRestartUtility(this); diff --git a/cave/com.raytheon.viz.textworkstation/src/com/raytheon/viz/textworkstation/TextWorkstationDlg.java b/cave/com.raytheon.viz.textworkstation/src/com/raytheon/viz/textworkstation/TextWorkstationDlg.java index b0bb8d4ce2..4f4eefef4c 100644 --- a/cave/com.raytheon.viz.textworkstation/src/com/raytheon/viz/textworkstation/TextWorkstationDlg.java +++ b/cave/com.raytheon.viz.textworkstation/src/com/raytheon/viz/textworkstation/TextWorkstationDlg.java @@ -163,6 +163,8 @@ public class TextWorkstationDlg extends CaveSWTDialog implements public TextWorkstationDlg(Shell parent, int block) { super(parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.RESIZE, CAVE.PERSPECTIVE_INDEPENDENT | CAVE.INDEPENDENT_SHELL | block); + + // Do not allow other CAVE styles to be passed to this constructor. Assert.isTrue(block == CAVE.DO_NOT_BLOCK || block == CAVE.NONE); setText("Text Workstation");