Issue #1229 - Issue #1229 - Change to use non-blocking.

Change-Id: I2da0ebd176f7f50d63d70aed28bfe3385ac39a48

Former-commit-id: 0bffd25bdc [formerly 7769d4cc14] [formerly 860bd4af04 [formerly ae8a0dcce3055931c901093e148639f959c70a97]]
Former-commit-id: 860bd4af04
Former-commit-id: 3be1610080
This commit is contained in:
James Korman 2012-10-11 11:28:49 -05:00
parent 4ac301ad02
commit 502510ff48
3 changed files with 31 additions and 6 deletions

View file

@ -135,7 +135,8 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* 10/09/2012 1229 rferrel Made dialog non-blocking.
* 10/10/2012 1229 rferrel Changes for non-blocking ResourceEditorDlg.
* 10/10/2012 1229 rferrel Changes for non-blocking TransmissionQueueDlg.
* 10/10/2012 1229 jkorman Changes for AlertDialog to support non-blocking.
* 10/10/2012 1229 jkorman Changes for AlertDialog to support non-blocking.
* 10/11/2012 1229 jkorman Changes for BackupDialog to support non-blocking.
* </pre>
*
* @author grichard
@ -193,6 +194,11 @@ public class TafMonitorDlg extends CaveSWTDialog {
*/
private ResourceEditorDlg resDlg;
/**
*
*/
private BackupDialog backupDialog;
/**
* Alert configuration dialog.
*/
@ -684,9 +690,14 @@ public class TafMonitorDlg extends CaveSWTDialog {
backupBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
BackupDialog backup = new BackupDialog(shell,
productDisplayList);
backup.open();
if(mustCreate(backupDialog)) {
backupDialog = new BackupDialog(shell,
productDisplayList);
backupDialog.open();
} else {
// No, so use the existing dialog.
backupDialog.bringToTop();
}
}
});

View file

@ -55,7 +55,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* in initializeComponents.
* 10/06/2010 6009 rferrel Use product to get initial selected item.
* 3/14/2011 8588 rferrel Allow selection of multiple products.
*
* 20121010 1229 jkorman Added DO_NOT_BLOCK so dialog does not block on open.
* </pre>
*
* @author lvenable
@ -88,7 +88,7 @@ public class BackupDialog extends CaveSWTDialog {
*/
public BackupDialog(Shell parent, java.util.List<String> productDisplayList) {
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 Backup");
this.productDisplayList = productDisplayList;
}

View file

@ -52,6 +52,7 @@ import org.eclipse.swt.widgets.Shell;
* Nov 2, 2010 mschenke Initial creation
* Sep 12, 2012 #1165 lvenable Update for the initial process
* of removing the dialog blocking capability.
* Oct 11, 2012 1229 jkorman Factored out "mustCreate" method from subclasses.
*
* </pre>
*
@ -506,4 +507,17 @@ public abstract class CaveSWTDialogBase extends Dialog {
this.caveStyle = caveStyle | CAVE.DO_NOT_BLOCK;
this.closeCallback = callback;
}
/**
* Determines if the supplied reference should be created.
*
* @param dialog
* A dialog reference.
* @return Should the supplied reference should be created.
*/
public boolean mustCreate(CaveSWTDialogBase dialog) {
return (dialog == null) || (dialog.getShell() == null)
|| (dialog.isDisposed());
}
}