Merge "Issue #1229 Changes for non-blocking TimeSelectorDialog." into development

Former-commit-id: 8fad036c514ec9c55e38888ce9013c983665fb8a
This commit is contained in:
Nate Jensen 2012-10-11 11:18:14 -05:00 committed by Gerrit Code Review
commit a2c665644d
2 changed files with 26 additions and 5 deletions

View file

@ -69,6 +69,7 @@ import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
import com.raytheon.viz.avnconfig.HelpUsageDlg;
import com.raytheon.viz.avnconfig.MessageStatusComp;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
import com.raytheon.viz.ui.dialogs.ICloseCallback;
/**
* WeatherPlotDialog class displays the Weather Plot dialog for AvnFPS.
@ -85,6 +86,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* as WeatherPlotDataManager.
* 04/28/2011 8065 rferrel Use cache data.
* 10/02/2012 1229 rferrel Made dialog non-blocking.
* 10/10/2012 1229 rferrel Changes for non-blocking TimeSelectorDlg.
*
* </pre>
*
@ -214,6 +216,8 @@ public class WeatherPlotDialog extends CaveSWTDialog {
*/
private List<String> icaos;
private TimeSelectorDialog timeDlg;
/**
* Constructor.
*
@ -411,10 +415,25 @@ public class WeatherPlotDialog extends CaveSWTDialog {
timesBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
TimeSelectorDialog timeDlg = new TimeSelectorDialog(shell,
wxPlotCfg);
if ((Boolean) timeDlg.open()) {
displayData();
if (timeDlg == null || timeDlg.getShell() == null
|| timeDlg.isDisposed()) {
timeDlg = new TimeSelectorDialog(shell, wxPlotCfg);
timeDlg.setCloseCallback(new ICloseCallback() {
@Override
public void dialogClosed(Object returnValue) {
if (returnValue instanceof Boolean) {
boolean value = (Boolean) returnValue;
if (value) {
displayData();
}
}
}
});
timeDlg.open();
} else {
timeDlg.bringToTop();
}
}
});

View file

@ -49,6 +49,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* ------------ ---------- ----------- --------------------------
* 28 FEB 2008 938 lvenable Initial creation.
* 3/27/2008 1033 grichard Added ETA-MOS label.
* 10/10/2012 1229 rferrel Make dialog non-blocking.
*
* </pre>
*
@ -95,7 +96,8 @@ public class TimeSelectorDialog extends CaveSWTDialog {
*/
public TimeSelectorDialog(Shell parent, WxPlotCfg wxPlotCfg) {
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE,
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.MODE_INDEPENDENT);
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.MODE_INDEPENDENT
| CAVE.DO_NOT_BLOCK);
setText("AvnFPS Time Selector");
this.wxPlotCfg = wxPlotCfg;
}