Examples of InputDialog


Examples of org.eclipse.jface.dialogs.InputDialog

   
    // open an input dialog so that the user can enter a new task tag
    Shell shell =
      PerlEditorPlugin
      .getWorkbenchWindow().getShell();   
    InputDialog inputDialog = new InputDialog(shell, "New Task Tag...", "Enter new Task Tag:", "", null);
    int returnCode = inputDialog.open();
   
    if (returnCode == Window.OK) {
      result = inputDialog.getValue();
    }
   
    return result;
 
View Full Code Here

Examples of org.eclipse.jface.dialogs.InputDialog

        btnAdd.addSelectionListener(new SelectionAdapter()
        {
            @Override
            public void widgetSelected(SelectionEvent e)
            {
                InputDialog dialog = new InputDialog(getShell(), "Add Resource",
                    "Enter resource name", "", new IInputValidator()
                    {
                        public String isValid(String newText)
                        {
                            String error = null;
                            if (newText == null || newText.length() == 0)
                            {
                                error = "Name must not be empty.";
                            }
                            else if (resources.contains(newText))
                            {
                                error = "Specified resource name is already on the list.";
                            }
                            return error;
                        }
                    });

                if (dialog.open() == Window.OK)
                {
                    String value = dialog.getValue();
                    resources.add(value);
                    viewer.add(value);
                }
            }
        });
View Full Code Here

Examples of org.eclipse.jface.dialogs.InputDialog

   */
  public void run(IAction action) {
    if (this.node==null) {
      return;
    }
        InputDialog id = new InputDialog(shell, "Change Node Name", "Enter new name for node '" + node.getDescription()
                + "':", node.getLabel(), new IInputValidator() {
         
          @Override
          public String isValid(String newText) {
            if (newText!=null && newText.trim().length()>0 && newText.trim().equals(newText)) {
              return null;
            } else {
              return "Invalid input";
            }
          }
        });
    if (id.open() == IStatus.OK) {
      node.rename(id.getValue());
    }
  }
View Full Code Here

Examples of org.eclipse.jface.dialogs.InputDialog

    };

    rename = new Action(getCaption("collection.renameColl")) {
      @Override
      public void run() {
        InputDialog dialog = new InputDialog(view.getSite().getShell(),
            getCaption("collection.renameColl"),
            getCaption("collection.msg.newCollName"),
            col.getName(), new RequiredInputValidator(
                getCaption("collection.msg.inputCollName")));
        if (dialog.open() == InputDialog.OK) {
          try {
            col.rename(dialog.getValue());
          } catch (MongoException ex) {
            UIUtils.openErrorDialog(view.getSite().getShell(),
                ex.toString());
          }
          view.getViewer().refresh(getParent());
View Full Code Here

Examples of org.eclipse.jface.dialogs.InputDialog

    public CreateCollectionAction() {
      super("Create Collection");
    }

    public void run() {
      InputDialog dialog = new InputDialog(view.getSite().getShell(),
          getCaption("database.newCollection.title"),
          getCaption("database.newCollection.msg"), "",
          new RequiredInputValidator(
              getCaption("database.newCollection.errorMsg")));
      if (dialog.open() == InputDialog.OK) {
        try {
          db.createCollection(dialog.getValue(), new BasicDBObject());
        } catch (MongoException ex) {
          UIUtils.openErrorDialog(view.getSite().getShell(),
              ex.toString());
        }
        view.getViewer().refresh(Database.this);
View Full Code Here

Examples of org.eclipse.jface.dialogs.InputDialog

        final List<String> sel = field.getSelectedElements();
        field.removeElements(sel);
    }

    private void addPath(final ListDialogField<String> field) {
        final InputDialog dlg = new InputDialog(new Shell(), "Add path",
                "Enter a path to be added to ", "", null);
        dlg.setBlockOnOpen(true);
        dlg.open();
        final String value = dlg.getValue();

        if (value != null && value.length() > 0) {
            final File f = new File(value);
            if (f.exists()) {
                field.addElement(value);
View Full Code Here

Examples of org.eclipse.jface.dialogs.InputDialog

            return;
        }

        // open input dialog

        final InputDialog nameDialog = new InputDialog(shell, "Saving coverage results",
                "Enter the name for saving coverage results", statName.toString(),
                new IInputValidator() {

                    @Override
                    public String isValid(final String newText) {

                        final String[] names = dir.list();

                        if (newText == null || newText.length() < 1) {
                            return "Name too short";
                        }

                        for (final String name : names) {
                            if (name.equals(newText)) {
                                return "Results file with the same name already exists";
                            }
                        }

                        return null;
                    }

                });

        nameDialog.open();

        String name = "";
        if (nameDialog.getReturnCode() == Window.OK) {
            name = nameDialog.getValue();
        } else {
            return;
        }

        //
View Full Code Here

Examples of org.eclipse.jface.dialogs.InputDialog

            @Override
            public void widgetSelected(final SelectionEvent e) {
                final String[] configurations = ConfigurationManager.getTPConfigs();
                final Set<String> existingNames = new HashSet<String>(Arrays
                        .asList(configurations));
                final InputDialog dialog = new ConfigurationSaveAsDialog(parent
                        .getShell(), "Save trace pattern configuration",
                        "Enter name for configuration:", patternsConfigName,
                        existingNames);

                if (dialog.open() == Window.OK) {
                    if (ConfigurationManager.saveTPConfig(dialog.getValue())) {
                        patternsConfigName = dialog.getValue();
                        configNameLabel.setText(patternsConfigName);
                    } else {
                        final MessageBox messageBox = new MessageBox(parent.getShell(),
                                SWT.ICON_ERROR | SWT.OK);
                        messageBox.setMessage("Unable to save configuration: "
                                + dialog.getValue());
                        messageBox.setText("Error");
                        messageBox.open();
                    }
                }
            }
View Full Code Here

Examples of org.eclipse.jface.dialogs.InputDialog

            @Override
            public void widgetSelected(final SelectionEvent e) {
                final String[] configurations = ConfigurationManager.getNodesConfig();
                final Set<String> existingNames = new HashSet<String>(Arrays
                        .asList(configurations));
                final InputDialog dialog = new ConfigurationSaveAsDialog(parent
                        .getShell(), "Save nodes configuration",
                        "Enter name for configuration:", nodesConfigName, existingNames);

                if (dialog.open() == Window.OK) {
                    if (ConfigurationManager.saveNodesConfig(dialog.getValue())) {
                        nodesConfigName = dialog.getValue();
                        configNameLabel.setText(nodesConfigName);
                    } else {
                        final MessageBox messageBox = new MessageBox(parent.getShell(),
                                SWT.ICON_ERROR | SWT.OK);
                        messageBox.setMessage("Unable to save configuration: "
                                + dialog.getValue());
                        messageBox.setText("Error");
                        messageBox.open();
                    }
                }
            }
View Full Code Here

Examples of org.eclipse.jface.dialogs.InputDialog

    private void handleLargeModulesCall(final IErlSelection wranglerSelection,
            final Shell shell) {
        CodeInspectionViewsManager.hideView(
                CodeInspectionViewsManager.CODE_INSPECTION_VIEW, LARGE_MODULES_VIEW_ID);

        final InputDialog dialog = new InputDialog(shell, "Lines of a large module",
                "Lines of a large module:", "", new IntegerInputValidator());
        final int ret = dialog.open();
        if (ret == Window.CANCEL) {
            return;
        }
        final int lines = Integer.parseInt(dialog.getValue());
        final RpcResult res = WranglerBackendManager
                .getRefactoringBackend()
                .callInspection("large_modules_eclipse", "ixi", lines,
                        wranglerSelection.getSearchPath(), GlobalParameters.getTabWidth());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.