Issue #1287 Changes for non-blocking CreateFromScratchDialog.

Change-Id: I8a2152d834966992f8d4bbe8e4b72f7d9c7c3da0

Former-commit-id: 719be123fb [formerly 58ada46176] [formerly 50d65fefcb] [formerly 719be123fb [formerly 58ada46176] [formerly 50d65fefcb] [formerly 9fa924aecb [formerly 50d65fefcb [formerly 1cf83fa5e226f551c5d4cad3b5fa9f97b3203733]]]]
Former-commit-id: 9fa924aecb
Former-commit-id: a0ed28e7cf [formerly 34b84bcf2a] [formerly d959f8dd660ff29c640dee5273dd79773991ddc4 [formerly c6752668e4]]
Former-commit-id: 2bb75e766cc4b0e1e87392c40454ff9054a65e30 [formerly 823e1099e9]
Former-commit-id: 60dfce2758
This commit is contained in:
Roger Ferrel 2012-10-24 10:52:51 -05:00
parent 28adc6b2f0
commit 85e91172bc
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 * Feb 27, 2008 Eric Babin Initial Creation
* 04/18/08 #857 bphillip Implemented interaction with server * 04/18/08 #857 bphillip Implemented interaction with server
* Oct 24, 2012 #1287 rferrel Changes for non-blocking CreateFromScratchDialog.
* *
* </pre> * </pre>
* *
@ -44,6 +45,7 @@ import com.raytheon.viz.gfe.dialogs.CreateFromScratchDialog;
*/ */
public class ShowCreateFromScratchDialog extends AbstractHandler { public class ShowCreateFromScratchDialog extends AbstractHandler {
private CreateFromScratchDialog dialog;
/* /*
* (non-Javadoc) * (non-Javadoc)
@ -54,12 +56,16 @@ public class ShowCreateFromScratchDialog extends AbstractHandler {
*/ */
@Override @Override
public Object execute(ExecutionEvent arg0) throws ExecutionException { public Object execute(ExecutionEvent arg0) throws ExecutionException {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow() if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
.getShell(); Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
CreateFromScratchDialog dialog = new CreateFromScratchDialog(shell); dialog = new CreateFromScratchDialog(shell);
dialog.setBlockOnOpen(true); dialog.setBlockOnOpen(false);
dialog.open(); dialog.open();
} else {
dialog.bringToTop();
}
return null; return null;
} }

View file

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