Issue #1229 Alow TextWS to be a blocking dialog when stand alone.

Change-Id: I654f8528bb45be4be1deb58e96b073b4b46ef3d1

Former-commit-id: e287b4cf00 [formerly 145b502c31] [formerly ce8157b796] [formerly 455bd4a23e [formerly ce8157b796 [formerly defd0805252f955ca74743b1367ddf0f7e45b2db]]]
Former-commit-id: 455bd4a23e
Former-commit-id: 457216c7576c916832e4c4b7af4f3f52e7415d8b [formerly e8513d7cf3]
Former-commit-id: 9965ae1281
This commit is contained in:
Roger Ferrel 2012-10-02 16:04:25 -05:00
parent 922dd8f1bb
commit 786ee2c492
2 changed files with 24 additions and 3 deletions

View file

@ -4,6 +4,7 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.viz.ui.dialogs.CaveSWTDialogBase.CAVE;
import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
/**
@ -36,6 +37,7 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 28, 2011 mschenke Initial creation
* Oct 02, 2012 1229 rferrel Make a blocking dialog.
*
* </pre>
*
@ -56,7 +58,7 @@ public class TextWorkstationComponent extends AbstractCAVEComponent {
protected void startInternal(String componentName) throws Exception {
SerializationUtil.getJaxbContext();
TextWorkstationDlg textWorkstationDlg = new TextWorkstationDlg(
new Shell(Display.getCurrent()));
new Shell(Display.getCurrent()), CAVE.NONE);
textWorkstationDlg.open();
}

View file

@ -28,6 +28,7 @@ import java.util.TimeZone;
import java.util.Timer;
import java.util.TimerTask;
import org.eclipse.core.runtime.Assert;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@ -88,6 +89,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* 03Nov2011 11450 rferrel Change how old products pruge so it is no longer
* on times on two machines being in synch.
* 26Sep2012 1196 lvenable Dialog refactor to not block.
* 02Oct2012 1229 rferrel Option to allow blocking when top dialog.
*
* </pre>
*
@ -141,10 +143,27 @@ public class TextWorkstationDlg extends CaveSWTDialog implements
/** Select user ID dialog */
private SelectUserIdDlg userIdDlg;
/**
* Create a non-blocking dialog
*
* @param parent
*/
public TextWorkstationDlg(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 TextWorkstationDlg(Shell parent, int block) {
super(parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.RESIZE,
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.INDEPENDENT_SHELL
| CAVE.DO_NOT_BLOCK);
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.INDEPENDENT_SHELL | block);
Assert.isTrue(block == CAVE.DO_NOT_BLOCK || block == CAVE.NONE);
setText("Text Workstation");
TextDisplayModel.getInstance().setTextAviation(