Issue #1229 Changes to make GenScriptsDlg non-blocking.
Change-Id: I1b5e7b49825e9457b0804e71f2ff1d3bb7603840 Former-commit-id: 2b15bb971d700ffdbb185399fd69a6546379ae54
This commit is contained in:
parent
d0c760764f
commit
4434a48444
3 changed files with 55 additions and 26 deletions
|
@ -73,6 +73,7 @@ import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
|||
import com.raytheon.viz.avnconfig.HelpUsageDlg;
|
||||
import com.raytheon.viz.avnconfig.TafSiteConfigFactory;
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
|
||||
/**
|
||||
* This class displays the main Climate Data dialog.
|
||||
|
@ -92,7 +93,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* May 24, 2011 #9075 rferrel Changed getObsHistoryFromInv() to scan
|
||||
* ish-inventory.txt only one time.
|
||||
* Oct 04, 2012 #1229 rferrel Made non-blocking.
|
||||
* Oct 04, 2012 #1229 rfrreel Changes of non-blocking ClimateHistoryDlg.
|
||||
* Oct 04, 2012 #1229 rferrel Changes for non-blocking ClimateHistoryDlg.
|
||||
* Oct 08, 2012 #1229 rferrel Changes for non-blocking GenScriptsDlg.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -869,12 +871,20 @@ public class ClimateDataMenuDlg extends CaveSWTDialog {
|
|||
* Display the generate scripts dialog.
|
||||
*/
|
||||
private void displayGenerateScriptDialog() {
|
||||
if (generateScriptsDlg == null) {
|
||||
if (generateScriptsDlg == null || generateScriptsDlg.getShell() == null
|
||||
|| generateScriptsDlg.isDisposed()) {
|
||||
ClimateDataManager.getInstance().assessStationsMap(this);
|
||||
generateScriptsDlg = new GenScriptsDlg(shell);
|
||||
Boolean bool = (Boolean) generateScriptsDlg.open("data");
|
||||
generateScriptsDlg = null;
|
||||
genScriptsBtn.setEnabled(bool);
|
||||
generateScriptsDlg = new GenScriptsDlg(shell, "data");
|
||||
generateScriptsDlg.setCloseCallback(new ICloseCallback() {
|
||||
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
genScriptsBtn.setEnabled((Boolean) returnValue);
|
||||
}
|
||||
});
|
||||
generateScriptsDlg.open();
|
||||
} else {
|
||||
generateScriptsDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -70,6 +70,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* to the correct directory.
|
||||
* May 10, 2011 #8844 rferrel Display error message when unable
|
||||
* to save a script.
|
||||
* Oct 08, 2012 #1229 rferrel Made non-blocking.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -132,23 +133,16 @@ public class GenScriptsDlg extends CaveSWTDialog {
|
|||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param style
|
||||
* @param parentShell
|
||||
* Parent shell.
|
||||
*/
|
||||
public GenScriptsDlg(Shell parentShell) {
|
||||
super(parentShell, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT);
|
||||
public GenScriptsDlg(Shell parentShell, String style) {
|
||||
super(parentShell, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT
|
||||
| CAVE.DO_NOT_BLOCK);
|
||||
setText("Generate Scripts");
|
||||
initFtpArgs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Open the dialog.
|
||||
*
|
||||
* @return null.
|
||||
*/
|
||||
public Object open(String style) {
|
||||
this.style = style;
|
||||
return open();
|
||||
initFtpArgs();
|
||||
}
|
||||
|
||||
public void preOpened() {
|
||||
|
|
|
@ -43,6 +43,7 @@ import com.raytheon.uf.common.status.UFStatus;
|
|||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
|
||||
/**
|
||||
* This class displays the NCDC Inventory/History dialog.
|
||||
|
@ -53,6 +54,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 16, 2009 #3438 lvenable Initial creation
|
||||
* Oct 08, 2012 #1229 rferrel Changes for non-blocking GenScriptsDlg.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -225,10 +227,22 @@ public class NCDCInvHistDlg extends CaveSWTDialog {
|
|||
invScriptBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
if (generateScriptsDlg == null) {
|
||||
generateScriptsDlg = new GenScriptsDlg(shell);
|
||||
generateScriptsDlg.open("inv");
|
||||
generateScriptsDlg = null;
|
||||
if (generateScriptsDlg == null
|
||||
|| generateScriptsDlg.getShell() == null
|
||||
|| generateScriptsDlg.isDisposed()) {
|
||||
histScriptBtn.setEnabled(false);
|
||||
|
||||
generateScriptsDlg = new GenScriptsDlg(shell, "inv");
|
||||
generateScriptsDlg.setCloseCallback(new ICloseCallback() {
|
||||
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
histScriptBtn.setEnabled(true);
|
||||
}
|
||||
});
|
||||
generateScriptsDlg.open();
|
||||
} else {
|
||||
generateScriptsDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -300,10 +314,21 @@ public class NCDCInvHistDlg extends CaveSWTDialog {
|
|||
histScriptBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
if (generateScriptsDlg == null) {
|
||||
generateScriptsDlg = new GenScriptsDlg(shell);
|
||||
generateScriptsDlg.open("his");
|
||||
generateScriptsDlg = null;
|
||||
if (generateScriptsDlg == null
|
||||
|| generateScriptsDlg.getShell() == null
|
||||
|| generateScriptsDlg.isDisposed()) {
|
||||
invScriptBtn.setEnabled(false);
|
||||
generateScriptsDlg = new GenScriptsDlg(shell, "his");
|
||||
generateScriptsDlg.setCloseCallback(new ICloseCallback() {
|
||||
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
invScriptBtn.setEnabled(true);
|
||||
}
|
||||
});
|
||||
generateScriptsDlg.open();
|
||||
} else {
|
||||
generateScriptsDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue