Issue #1287 Changes for non-blocking DefineSamplesViaLatLongDialog.

Change-Id: Id9b6d7feec00ae483f80cfa386ad31fdce3d8dea

Former-commit-id: 8d8850174e [formerly a90e1b6f168e54d3a1a6581b692e84288de537f3]
Former-commit-id: 122012d767
This commit is contained in:
Roger Ferrel 2012-10-24 09:30:03 -05:00
parent 277c5c1a1d
commit 6aab2f1d8b
2 changed files with 13 additions and 7 deletions

View file

@ -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.
*
* </pre>
*
@ -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;
}

View file

@ -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.
* </pre>
*
* @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