Issue #1353 Changes for non-blocking DamDisplayControlDlg.

Change-Id: I8a07b7ed7a7e46d243f0319850e2611e0cd05475

Former-commit-id: 25051f8e5de207d39cedcf5ff42ec1f8305c5c9a
This commit is contained in:
Roger Ferrel 2012-12-10 11:28:41 -06:00
parent 59b2cf8872
commit 35261a7964
2 changed files with 42 additions and 18 deletions

View file

@ -39,6 +39,7 @@ import org.eclipse.ui.PlatformUI;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 6/27/06 randerso Initial Creation. * 6/27/06 randerso Initial Creation.
* 12/10/2013 1353 rferrel Changes for non-blocking DamDisplayControlDlg.
* *
* </pre> * </pre>
* *
@ -46,15 +47,25 @@ import org.eclipse.ui.PlatformUI;
* *
*/ */
public class DamDisplayAction extends AbstractHandler { public class DamDisplayAction extends AbstractHandler {
private DamDisplayControlDlg damDisplayDlg;
@Override /*
public Object execute(ExecutionEvent arg0) throws ExecutionException { * (non-Javadoc)
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow() *
.getShell(); * @see
DamDisplayControlDlg damDisplayDlg = new DamDisplayControlDlg(shell); * org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands
damDisplayDlg.open(); * .ExecutionEvent)
*/
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
if (damDisplayDlg == null) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
damDisplayDlg = new DamDisplayControlDlg(shell);
}
damDisplayDlg.open();
return null; return null;
} }
} }

View file

@ -65,17 +65,17 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* *
*/ */
public class DamDisplayControlDlg extends CaveSWTDialog { public class DamDisplayControlDlg extends CaveSWTDialog {
private static final String GREATER_THAN = "greater than"; private final String GREATER_THAN = "greater than";
private static final String EQUAL_TO = "equal to"; private final String EQUAL_TO = "equal to";
private static final String LESS_THAN = "less than"; private final String LESS_THAN = "less than";
private static final String ALL = "All"; private final String ALL = "All";
private static final String CENTER_LAT_TOKEN = "hv_center_lat"; private final String CENTER_LAT_TOKEN = "hv_center_lat";
private static final String CENTER_LON_TOKEN = "hv_center_lon"; private final String CENTER_LON_TOKEN = "hv_center_lon";
/** /**
* Dam volume combo box. * Dam volume combo box.
@ -161,13 +161,18 @@ public class DamDisplayControlDlg extends CaveSWTDialog {
* Parent shell. * Parent shell.
*/ */
public DamDisplayControlDlg(Shell parent) { public DamDisplayControlDlg(Shell parent) {
super(parent); super(parent, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK);
setText("Dam Display Control"); setText("Dam Display Control");
waitCursor = new Cursor(parent.getDisplay(), SWT.CURSOR_WAIT); waitCursor = new Cursor(parent.getDisplay(), SWT.CURSOR_WAIT);
arrowCursor = new Cursor(parent.getDisplay(), SWT.CURSOR_ARROW); arrowCursor = new Cursor(parent.getDisplay(), SWT.CURSOR_ARROW);
} }
/*
* (non-Javadoc)
*
* @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#constructShellLayout()
*/
@Override @Override
protected Layout constructShellLayout() { protected Layout constructShellLayout() {
GridLayout mainLayout = new GridLayout(1, true); GridLayout mainLayout = new GridLayout(1, true);
@ -176,6 +181,13 @@ public class DamDisplayControlDlg extends CaveSWTDialog {
return mainLayout; return mainLayout;
} }
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#initializeComponents(org
* .eclipse.swt.widgets.Shell)
*/
@Override @Override
protected void initializeComponents(Shell shell) { protected void initializeComponents(Shell shell) {
setReturnValue(false); setReturnValue(false);
@ -384,9 +396,10 @@ public class DamDisplayControlDlg extends CaveSWTDialog {
PointDataControlManager pdcManager = PointDataControlManager PointDataControlManager pdcManager = PointDataControlManager
.getInstance(); .getInstance();
DamLocationResource dlr = pdcManager.getDamLocationResource(); DamLocationResource dlr = pdcManager.getDamLocationResource();
dlr.unload(); if (dlr != null) {
pdcManager.setRedraw(true); dlr.unload();
pdcManager.setRedraw(true);
}
} }
}); });