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

View file

@ -65,17 +65,17 @@ import com.raytheon.viz.ui.dialogs.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.
@ -161,13 +161,18 @@ public class DamDisplayControlDlg extends CaveSWTDialog {
* Parent shell.
*/
public DamDisplayControlDlg(Shell parent) {
super(parent);
super(parent, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK);
setText("Dam Display Control");
waitCursor = new Cursor(parent.getDisplay(), SWT.CURSOR_WAIT);
arrowCursor = new Cursor(parent.getDisplay(), SWT.CURSOR_ARROW);
}
/*
* (non-Javadoc)
*
* @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#constructShellLayout()
*/
@Override
protected Layout constructShellLayout() {
GridLayout mainLayout = new GridLayout(1, true);
@ -176,6 +181,13 @@ public class DamDisplayControlDlg extends CaveSWTDialog {
return mainLayout;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#initializeComponents(org
* .eclipse.swt.widgets.Shell)
*/
@Override
protected void initializeComponents(Shell shell) {
setReturnValue(false);
@ -384,9 +396,10 @@ public class DamDisplayControlDlg extends CaveSWTDialog {
PointDataControlManager pdcManager = PointDataControlManager
.getInstance();
DamLocationResource dlr = pdcManager.getDamLocationResource();
if (dlr != null) {
dlr.unload();
pdcManager.setRedraw(true);
}
}
});