Merge "Issue #1229 Made AviationDialog blocking when stand along." into development

Former-commit-id: 31153efb84 [formerly ee179ab5ce] [formerly 31153efb84 [formerly ee179ab5ce] [formerly a3e53c21f6 [formerly 7187662a29a2b3b69e113113a1c7a5f95cdaecd3]]]
Former-commit-id: a3e53c21f6
Former-commit-id: b4270078ca [formerly 272c84b56b]
Former-commit-id: e2e9e0f84e
This commit is contained in:
Lee Venable 2012-10-08 13:05:49 -05:00 committed by Gerrit Code Review
commit 671f4b197c
3 changed files with 22 additions and 3 deletions

View file

@ -22,6 +22,7 @@ package com.raytheon.viz.aviation;
import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
import com.raytheon.viz.ui.dialogs.CaveSWTDialogBase.CAVE;
import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent; import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
/** /**
@ -35,6 +36,7 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Apr 28, 2011 mschenke Initial creation * Apr 28, 2011 mschenke Initial creation
* Oct 08, 2012 1229 rferrel Make a blocking dialog.
* *
* </pre> * </pre>
* *
@ -54,7 +56,7 @@ public class AviationComponent extends AbstractCAVEComponent {
@Override @Override
protected void startInternal(String componentName) throws Exception { protected void startInternal(String componentName) throws Exception {
AviationDialog aviationDlg = new AviationDialog(new Shell( AviationDialog aviationDlg = new AviationDialog(new Shell(
Display.getCurrent())); Display.getCurrent()), CAVE.NONE);
aviationDlg.open(); aviationDlg.open();
} }

View file

@ -27,6 +27,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import javax.xml.bind.JAXB; import javax.xml.bind.JAXB;
import org.eclipse.core.runtime.Assert;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionEvent;
@ -173,14 +174,28 @@ public class AviationDialog extends CaveSWTDialog implements IBackupRestart {
private final AtomicInteger dlgCount = new AtomicInteger(0); private final AtomicInteger dlgCount = new AtomicInteger(0);
/** /**
* Constructor. * Create a non-blocking dialog.
* *
* @param parent * @param parent
* Parent Shell. * Parent Shell.
*/ */
public AviationDialog(Shell parent) { public AviationDialog(Shell parent) {
this(parent, CAVE.DO_NOT_BLOCK);
}
/**
* Create dialog specifying NONE for blocking and DO_NOT_BLOCK for
* non-blocking dialog.
*
* @param parent
* @param block
* - CAVE.DO_NOT_BLOCK or CAVE.NONE
*/
public AviationDialog(Shell parent, int block) {
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT
| CAVE.INDEPENDENT_SHELL | CAVE.DO_NOT_BLOCK); | CAVE.INDEPENDENT_SHELL | block);
// Do not allow other CAVE styles to be passed to this constructor.
Assert.isTrue(block == CAVE.DO_NOT_BLOCK || block == CAVE.NONE);
setText("AvnFPS Menu"); setText("AvnFPS Menu");
ForecastModel.getInstance().setBackupRestartUtility(this); ForecastModel.getInstance().setBackupRestartUtility(this);

View file

@ -163,6 +163,8 @@ public class TextWorkstationDlg extends CaveSWTDialog implements
public TextWorkstationDlg(Shell parent, int block) { public TextWorkstationDlg(Shell parent, int block) {
super(parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.RESIZE, super(parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.RESIZE,
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.INDEPENDENT_SHELL | block); CAVE.PERSPECTIVE_INDEPENDENT | CAVE.INDEPENDENT_SHELL | block);
// Do not allow other CAVE styles to be passed to this constructor.
Assert.isTrue(block == CAVE.DO_NOT_BLOCK || block == CAVE.NONE); Assert.isTrue(block == CAVE.DO_NOT_BLOCK || block == CAVE.NONE);
setText("Text Workstation"); setText("Text Workstation");