From 577c2b88ab2efffb3b011e7608831f23ecebd0e7 Mon Sep 17 00:00:00 2001 From: Roger Ferrel Date: Mon, 12 Nov 2012 14:20:40 -0600 Subject: [PATCH] Issue #1298 Changes for non-blocking NewToolDialog. Change-Id: I83bcbf9cf19785811d35b97d04442f404429fdb5 Former-commit-id: 6ec9c1fac42943fca316001745bf1b957d64ad5b [formerly 9c9a068908b7ad695d4cb087b1b6f405eb570004] [formerly 6ec9c1fac42943fca316001745bf1b957d64ad5b [formerly 9c9a068908b7ad695d4cb087b1b6f405eb570004] [formerly f48474fc82249918e0ec4205010af534d8f9d7bb [formerly b24c130aa9c612822dda92a9820912b0cd7bc852]]] Former-commit-id: f48474fc82249918e0ec4205010af534d8f9d7bb Former-commit-id: 398f71471d3ca76b71b547413c6829c68f17ae18 [formerly b11413b7f0ff20789b6acf0cd153a27889ff16cc] Former-commit-id: 6b0c3820d8b3687d3df17cf93ef9c4afe6455d27 --- .../viz/gfe/dialogs/NewToolDialog.java | 35 ++----------------- .../viz/gfe/smarttool/action/NewAction.java | 5 +++ 2 files changed, 8 insertions(+), 32 deletions(-) diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/NewToolDialog.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/NewToolDialog.java index 1cb826164c..bdbb693174 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/NewToolDialog.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/NewToolDialog.java @@ -41,18 +41,18 @@ import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.viz.gfe.core.DataManager; import com.raytheon.viz.gfe.core.parm.Parm; -import com.raytheon.viz.gfe.core.script.NewInputValidator; import com.raytheon.viz.gfe.smarttool.SmartToolEdit; import com.raytheon.viz.ui.dialogs.CaveJFACEDialog; /** - * Dialog for creating new smart tools + * Dialog for creating new smart tools. * *
  * SOFTWARE HISTORY
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Feb 20, 2008            njensen     Initial creation
+ * Nov 12, 2012 1298       rferrel     Changes for non-blocking dialog.
  * 
  * 
* @@ -74,6 +74,7 @@ public class NewToolDialog extends CaveJFACEDialog { super(aShell); title = aTitle; this.validator = validator; + setShellStyle(SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); } /* @@ -133,13 +134,9 @@ public class NewToolDialog extends CaveJFACEDialog { @Override protected void createButtonsForButtonBar(Composite parent) { - // okButton = createButton(parent, IDialogConstants.OK_ID, - // IDialogConstants.OK_LABEL, true); createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); - // cancelButton = createButton(parent, IDialogConstants.CANCEL_ID, - // IDialogConstants.CANCEL_LABEL, false); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); } @@ -164,8 +161,6 @@ public class NewToolDialog extends CaveJFACEDialog { top.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false)); Label label = new Label(top, SWT.NONE); - // label.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, - // false)); label.setText("Name"); text = new Text(top, SWT.BORDER); @@ -193,22 +188,6 @@ public class NewToolDialog extends CaveJFACEDialog { parms.setSelection(0); } - // Group typeGroup = new Group(comp, SWT.BORDER); - // typeGroup.setText("Tool Type:"); - // - // Button numericButton = new Button(typeGroup, SWT.RADIO); - // numericButton.setText("numeric"); - // numericButton.setLayoutData(new GridData(SWT.BEGINNING, - // SWT.BEGINNING, - // false, false)); - // numericButton.setBounds(10, 20, 120, 30); - // - // Button pointButton = new Button(typeGroup, SWT.RADIO); - // pointButton.setText("point-based"); - // pointButton.setBounds(10, 50, 120, 30); - // - // typeGroup.pack(); - applyDialogFont(composite); return composite; } @@ -237,12 +216,4 @@ public class NewToolDialog extends CaveJFACEDialog { private boolean isInputValid() { return (validator.isValid(text.getText()) == null); } - - public static void main(String[] args) { - Shell shell = new Shell(SWT.DIALOG_TRIM); - NewToolDialog d = new NewToolDialog(shell, "MyTool", - new NewInputValidator()); - d.open(); - } - } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/smarttool/action/NewAction.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/smarttool/action/NewAction.java index 53bef7f9e4..9437309c00 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/smarttool/action/NewAction.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/smarttool/action/NewAction.java @@ -33,6 +33,7 @@ import com.raytheon.viz.gfe.dialogs.NewToolDialog; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Feb 21, 2008 njensen Initial creation + * Nov 12, 2012 1298 rferrel Changes for non-blocking NewToolDialog. * * * @@ -51,8 +52,12 @@ public class NewAction extends AbstractSmartToolAction { if (!utility) { Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow() .getShell(); + // The dialog being opened is modal to the parent dialog. This will + // prevent the launching of another dialog until the modal dialog is + // closed. NewToolDialog d = new NewToolDialog(shell, "MyTool", new NewInputValidator()); + d.setBlockOnOpen(false); d.open(); } }