Issue #1287 Changes for non-blocking CreateFromScratchDialog.

Change-Id: I8a2152d834966992f8d4bbe8e4b72f7d9c7c3da0

Former-commit-id: 9fa924aecb [formerly 50d65fefcb [formerly 1cf83fa5e226f551c5d4cad3b5fa9f97b3203733]]
Former-commit-id: 50d65fefcb
Former-commit-id: 58ada46176
This commit is contained in:
Roger Ferrel 2012-10-24 10:52:51 -05:00
parent f7d694f7a1
commit 719be123fb
2 changed files with 22 additions and 13 deletions

View file

@ -36,6 +36,7 @@ import com.raytheon.viz.gfe.dialogs.CreateFromScratchDialog;
* ------------ ---------- ----------- --------------------------
* Feb 27, 2008 Eric Babin Initial Creation
* 04/18/08 #857 bphillip Implemented interaction with server
* Oct 24, 2012 #1287 rferrel Changes for non-blocking CreateFromScratchDialog.
*
* </pre>
*
@ -44,6 +45,7 @@ import com.raytheon.viz.gfe.dialogs.CreateFromScratchDialog;
*/
public class ShowCreateFromScratchDialog extends AbstractHandler {
private CreateFromScratchDialog dialog;
/*
* (non-Javadoc)
@ -54,12 +56,16 @@ public class ShowCreateFromScratchDialog extends AbstractHandler {
*/
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
CreateFromScratchDialog dialog = new CreateFromScratchDialog(shell);
dialog.setBlockOnOpen(true);
dialog.open();
dialog = new CreateFromScratchDialog(shell);
dialog.setBlockOnOpen(false);
dialog.open();
} else {
dialog.bringToTop();
}
return null;
}

View file

@ -46,6 +46,7 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 26, 2008 Eric Babin Initial Creation
* Oct 24, 2012 1287 rferrel Changes for non-blocking dialog.
*
* </pre>
*
@ -75,7 +76,7 @@ public class CreateFromScratchDialog extends CaveJFACEDialog {
public CreateFromScratchDialog(Shell parent) {
super(parent);
this.setShellStyle(SWT.TITLE | SWT.MODELESS | SWT.CLOSE);
this.setShellStyle(SWT.DIALOG_TRIM | SWT.MODELESS);
}
@ -130,8 +131,8 @@ public class CreateFromScratchDialog extends CaveJFACEDialog {
intervalLabel = new Label(top, SWT.NONE);
data = new GridData(30, SWT.DEFAULT);
intervalLabel.setLayoutData(data);
intervalLabel.setText(Integer
.toString(intervalScale.getSelection()));
intervalLabel
.setText(Integer.toString(intervalScale.getSelection()));
}
@ -157,8 +158,8 @@ public class CreateFromScratchDialog extends CaveJFACEDialog {
durationLabel = new Label(top, SWT.NONE);
data = new GridData(30, SWT.DEFAULT);
durationLabel.setLayoutData(data);
durationLabel.setText(Integer
.toString(durationScale.getSelection()));
durationLabel
.setText(Integer.toString(durationScale.getSelection()));
}
}
@ -167,8 +168,8 @@ public class CreateFromScratchDialog extends CaveJFACEDialog {
if (displayDuration) {
durationScale.setSelection(intervalScale.getSelection());
durationLabel.setText(Integer
.toString(durationScale.getSelection()));
durationLabel
.setText(Integer.toString(durationScale.getSelection()));
}
}
@ -272,7 +273,9 @@ public class CreateFromScratchDialog extends CaveJFACEDialog {
createDuration = durationScale.getSelection();
}
DataManager.getCurrentInstance().getParmOp()
DataManager
.getCurrentInstance()
.getParmOp()
.createFromScratchSelected(mode, createInterval * 3600,
createDuration * 3600);