Merge "Issue #1298 Changes for non-blocking GhgAlertDlg." into development
Former-commit-id:40f11cfba5
[formerly e96cd422716fc6da7c0007b58fa75659c7600ad7] Former-commit-id:0540d84e4e
This commit is contained in:
commit
eb297f00fc
2 changed files with 39 additions and 16 deletions
|
@ -47,6 +47,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 25 MAR 2008 N/A lvenable Initial creation
|
||||
* 15 NOV 2012 1298 rferrel Changes for non-blocking dialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -104,10 +105,15 @@ public class GhgAlertDlg extends CaveSWTDialog {
|
|||
* Parent Shell.
|
||||
*/
|
||||
public GhgAlertDlg(Shell parent) {
|
||||
super(parent);
|
||||
super(parent, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK);
|
||||
setText("GHG Monitor Alert Dialog");
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#constructShellLayout()
|
||||
*/
|
||||
@Override
|
||||
protected Layout constructShellLayout() {
|
||||
// Create the main layout for the shell.
|
||||
|
@ -118,11 +124,13 @@ public class GhgAlertDlg extends CaveSWTDialog {
|
|||
return mainLayout;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void disposed() {
|
||||
setReturnValue(alerts);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#initializeComponents(org
|
||||
* .eclipse.swt.widgets.Shell)
|
||||
*/
|
||||
@Override
|
||||
protected void initializeComponents(Shell shell) {
|
||||
// Initialize all of the controls and layouts
|
||||
|
@ -264,7 +272,8 @@ public class GhgAlertDlg extends CaveSWTDialog {
|
|||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
updateAlertingValues();
|
||||
shell.dispose();
|
||||
setReturnValue(alerts);
|
||||
close();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -275,8 +284,8 @@ public class GhgAlertDlg extends CaveSWTDialog {
|
|||
cancelBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
alerts = null;
|
||||
shell.dispose();
|
||||
setReturnValue(null);
|
||||
close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -90,6 +90,7 @@ import com.raytheon.viz.ghg.monitor.filter.GhgFilterEngine;
|
|||
import com.raytheon.viz.ghg.monitor.listener.GhgMonitorFilterChangeListener;
|
||||
import com.raytheon.viz.ghg.monitor.listener.GhgMonitorZoneSelectionListener;
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
import com.raytheon.viz.ui.statusline.EdgeLayout;
|
||||
import com.raytheon.viz.ui.statusline.EdgeLayout.EdgeLayoutData;
|
||||
import com.raytheon.viz.ui.statusline.EdgeLayout.EdgeLayoutData.EdgeAffinity;
|
||||
|
@ -109,6 +110,7 @@ import com.raytheon.viz.ui.statusline.StatusStore;
|
|||
* 25 MAR 2008 N/A lvenable Initial creation
|
||||
* 17Jun2008 1157 MW Fegan Pass configuration to sub-dialogs.
|
||||
* 15 Nov 2012 1298 rferrel Changes for non-blocking dialog.
|
||||
* Changes for non-blocking GhgAlertDlg.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -124,6 +126,8 @@ public class GhgMonitorDlg extends CaveSWTDialog implements
|
|||
|
||||
private static final Map<String, GhgConfigData.DataEnum> labelToEnumMap;
|
||||
|
||||
private GhgAlertDlg alertDlg;
|
||||
|
||||
/**
|
||||
* Active group one string.
|
||||
*/
|
||||
|
@ -1082,15 +1086,25 @@ public class GhgMonitorDlg extends CaveSWTDialog implements
|
|||
* Display the Define Alerts dialog.
|
||||
*/
|
||||
private void showDefineAlertsDialog() {
|
||||
GhgConfigData configuration = GhgConfigData.getInstance();
|
||||
GhgAlertDlg alertDlg = new GhgAlertDlg(getShell());
|
||||
alertDlg.setAlerts(configuration.getAlerts());
|
||||
GhgAlertsConfigData rtnAlerts = (GhgAlertsConfigData) alertDlg.open();
|
||||
if (alertDlg == null) {
|
||||
GhgConfigData configuration = GhgConfigData.getInstance();
|
||||
alertDlg = new GhgAlertDlg(getShell());
|
||||
alertDlg.setAlerts(configuration.getAlerts());
|
||||
alertDlg.setCloseCallback(new ICloseCallback() {
|
||||
|
||||
// null is returned if the dialog is canceled
|
||||
if (rtnAlerts != null) {
|
||||
configuration.setAlerts(rtnAlerts);
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
if (returnValue instanceof GhgAlertsConfigData) {
|
||||
GhgAlertsConfigData rtnAlerts = (GhgAlertsConfigData) returnValue;
|
||||
GhgConfigData configuration = GhgConfigData
|
||||
.getInstance();
|
||||
configuration.setAlerts(rtnAlerts);
|
||||
}
|
||||
alertDlg = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
alertDlg.open();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue