Issue #1298 Changes for non-blocking NewToolDialog.

Change-Id: I83bcbf9cf19785811d35b97d04442f404429fdb5

Former-commit-id: 6ec9c1fac4 [formerly 9c9a068908] [formerly f48474fc82 [formerly b24c130aa9c612822dda92a9820912b0cd7bc852]]
Former-commit-id: f48474fc82
Former-commit-id: b11413b7f0
This commit is contained in:
Roger Ferrel 2012-11-12 14:20:40 -06:00
parent 6ab3480255
commit 398f71471d
2 changed files with 8 additions and 32 deletions

View file

@ -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.
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 20, 2008 njensen Initial creation
* Nov 12, 2012 1298 rferrel Changes for non-blocking dialog.
*
* </pre>
*
@ -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();
}
}

View file

@ -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.
*
* </pre>
*
@ -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();
}
}