Issue #1229 Changes for non-blocking TimeSelectorDialog.

Change-Id: I4826e62fe68fb128b8d146f6d386101adc758a37

Former-commit-id: fcca46a4698610dd8a3124ab7e23a3b88913cd6a
This commit is contained in:
Roger Ferrel 2012-10-10 13:17:29 -05:00
parent 47d9a92acf
commit 624f6bfd01
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;
}