From ed86da12d782f78ebc195925896e3f8288268ed3 Mon Sep 17 00:00:00 2001 From: Roger Ferrel Date: Mon, 22 Oct 2012 15:34:21 -0500 Subject: [PATCH] Issue #1287 Changes for non-blocking but modal DisplayAttributesDialog. Change-Id: I57df579cd29ffa2bb54589bf5862121857abedb0 Former-commit-id: 8152c49231d0bc9020f81437894cd4e6b16cbec1 [formerly 8152c49231d0bc9020f81437894cd4e6b16cbec1 [formerly 4dca1f343e38090c21e27f0470cc68042c22c811]] Former-commit-id: b0c5e6472b90f09c9f19ba22f8bcfa1e9d1c7aae Former-commit-id: 8ac665a0ca0ddb8393457416a431fcee47c41c24 --- .../gfe/actions/DisplayAttributesAction.java | 21 ++++++++++++------- .../gfe/dialogs/DisplayAttributesDialog.java | 5 ++++- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/actions/DisplayAttributesAction.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/actions/DisplayAttributesAction.java index acc8ab9bc8..21df806fec 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/actions/DisplayAttributesAction.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/actions/DisplayAttributesAction.java @@ -27,7 +27,7 @@ import com.raytheon.viz.gfe.rsc.GFEResource; import com.raytheon.viz.ui.cmenu.AbstractRightClickAction; /** - * TODO Add Description + * Action to bring up the Dispaly attributes dialog. * *
  * 
@@ -35,6 +35,7 @@ import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Jan 13, 2009            mschenke     Initial creation
+ * Oct 22, 2012 1287       rferrel     Changes for non-blocking DisplayAttributesDialog.
  * 
  * 
* @@ -46,6 +47,8 @@ public class DisplayAttributesAction extends AbstractRightClickAction { private GFEResource rsc; + private DisplayAttributesDialog dialog; + /* * (non-Javadoc) * @@ -53,14 +56,18 @@ public class DisplayAttributesAction extends AbstractRightClickAction { */ @Override public void run() { - Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow() - .getShell(); + if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) { + Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow() + .getShell(); - rsc = ((GFEResource) this.getSelectedRsc()); + rsc = ((GFEResource) this.getSelectedRsc()); - DisplayAttributesDialog dad = new DisplayAttributesDialog(shell, rsc); - dad.setBlockOnOpen(true); - dad.open(); + dialog = new DisplayAttributesDialog(shell, rsc); + dialog.setBlockOnOpen(false); + dialog.open(); + } else { + dialog.bringToTop(); + } } /* diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/DisplayAttributesDialog.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/DisplayAttributesDialog.java index 8b617519c5..15f4f03bd5 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/DisplayAttributesDialog.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/DisplayAttributesDialog.java @@ -51,6 +51,8 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jun 11, 2008 Eric Babin Initial Creation + * Oct 22, 2012 1287 rferrel Make dialog application modal + * and non-blocking. * * * @@ -84,7 +86,7 @@ public class DisplayAttributesDialog extends CaveJFACEDialog { public DisplayAttributesDialog(Shell parent, GFEResource rsc) { super(parent); - this.setShellStyle(SWT.TITLE | SWT.MODELESS | SWT.CLOSE); + this.setShellStyle(SWT.TITLE | SWT.APPLICATION_MODAL | SWT.CLOSE); this.parm = rsc.getParm(); @@ -100,6 +102,7 @@ public class DisplayAttributesDialog extends CaveJFACEDialog { startImageTypes = null; startGraphicTypes = null; + setBlockOnOpen(false); } @Override