From 6aab2f1d8b394101ebbd02c476f9fe1a86cf0e8f Mon Sep 17 00:00:00 2001 From: Roger Ferrel Date: Wed, 24 Oct 2012 09:30:03 -0500 Subject: [PATCH] Issue #1287 Changes for non-blocking DefineSamplesViaLatLongDialog. Change-Id: Id9b6d7feec00ae483f80cfa386ad31fdce3d8dea Former-commit-id: 8d8850174e3b31a790b929f924a0425662924c87 [formerly a90e1b6f168e54d3a1a6581b692e84288de537f3] Former-commit-id: 122012d767d33924b1c9a93e66b9ff3b0b46d8f1 --- .../actions/ShowDefineSamplesLatLongAction.java | 17 +++++++++++------ .../dialogs/DefineSamplesViaLatLongDialog.java | 3 ++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/actions/ShowDefineSamplesLatLongAction.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/actions/ShowDefineSamplesLatLongAction.java index 5f4fb08d4d..72ba619ce7 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/actions/ShowDefineSamplesLatLongAction.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/actions/ShowDefineSamplesLatLongAction.java @@ -36,6 +36,7 @@ import com.raytheon.viz.gfe.dialogs.DefineSamplesViaLatLongDialog; * ------------ ---------- ----------- -------------------------- * Feb 15, 2008 Eric Babin Initial Creation * Apr 9, 2009 1288 rjpeter Removed explicit refresh of SpatialDisplayManager. + * Oct 24, 2012 1287 rferrel Changes for non-blocking DefineSamplesViaLatLongDialog. * * * @@ -44,6 +45,7 @@ import com.raytheon.viz.gfe.dialogs.DefineSamplesViaLatLongDialog; */ public class ShowDefineSamplesLatLongAction extends AbstractHandler { + private DefineSamplesViaLatLongDialog dialog; /* * (non-Javadoc) @@ -54,13 +56,16 @@ public class ShowDefineSamplesLatLongAction extends AbstractHandler { */ @Override public Object execute(ExecutionEvent arg0) throws ExecutionException { - Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow() - .getShell(); + if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) { + Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow() + .getShell(); - DefineSamplesViaLatLongDialog dialog = new DefineSamplesViaLatLongDialog( - shell); - dialog.setBlockOnOpen(true); - dialog.open(); + dialog = new DefineSamplesViaLatLongDialog(shell); + dialog.setBlockOnOpen(false); + dialog.open(); + } else { + dialog.bringToTop(); + } return null; } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/DefineSamplesViaLatLongDialog.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/DefineSamplesViaLatLongDialog.java index 49bcd0d708..56533b3245 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/DefineSamplesViaLatLongDialog.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/DefineSamplesViaLatLongDialog.java @@ -43,6 +43,7 @@ import com.vividsolutions.jts.geom.Coordinate; * ------------ ---------- ----------- -------------------------- * Feb 15, 2008 Eric Babin Initial Creation * 04/10/2009 #1290 rjpeter Moved field validation to when ok pressed. + * Oct 24, 2012 #1287 rferrel Change shell style. * * * @author ebabin @@ -61,7 +62,7 @@ public class DefineSamplesViaLatLongDialog extends CaveJFACEDialog { public DefineSamplesViaLatLongDialog(Shell parent) { super(parent); - this.setShellStyle(SWT.TITLE | SWT.MODELESS | SWT.CLOSE); + this.setShellStyle(SWT.DIALOG_TRIM | SWT.MODELESS); } @Override