Package org.eclipse.jface.dialogs

Examples of org.eclipse.jface.dialogs.InputDialog


      _publisherOptionsModel.remove((PublisherOption) _tablePublisherOptions.getTable().getSelection()[0].getData());
    }
  }

  protected void handleAddPublisherOption() {
    InputDialog dialog = new InputDialog(getSite().getShell(), "Add publisher option", "Please specify the publiser option name:", null, new IInputValidator() {

      public String isValid(String newText) {
        if (newText == null || newText.trim().equals("")) {
          return "";
        }
        if (WGADesignConfigurationModel.DIRECT_MODIFIABLE_PUBLISHER_OPTIONS.contains(newText.trim())) {
          return "Please use the corresponding control in the design editor to configure this option.";
        }
        return null;
      }
     
    });
    dialog.open();
    String optionName = dialog.getValue();
    if (optionName != null && !optionName.trim().equals("")) {
      PublisherOption option = new PublisherOption();
      option.setName(optionName);
      option.setValue("<value>");
      _publisherOptionsModel.add(option);
View Full Code Here


     * List adapter used for argument type list.
     */
    protected class ListAdapter implements IListAdapter {
        public void customButtonPressed(ListDialogField field, int index) {
            if (index == 0) { // "Add..." button
                InputDialog dialog = new InputDialog(getShell(), "Add Argument Type", "Specify an argument type to add:", "", null);
                if (dialog.open() == Window.OK && dialog.getValue().length() > 0) {
                    fArgumentTypesDialogField.addElement(new ArgumentType(dialog.getValue()));
                }
            }
        }
View Full Code Here

     * List adapter used for argument type list.
     */
    protected class ListAdapter implements IListAdapter {
        public void customButtonPressed(ListDialogField field, int index) {
            if (index == 0) { // "Add..." button
                InputDialog dialog = new InputDialog(getShell(), "Add Argument Type", "Specify an argument type to add:", "", null);
                if (dialog.open() == Window.OK && dialog.getValue().length() > 0) {
                    fArgumentTypesDialogField.addElement(new ArgumentType(dialog.getValue()));
                }
            }
        }
View Full Code Here

        {
            MessageDialog.openInformation(shell, "No selection", "Nothing has been selected.");
            return;
        }

        InputDialog inputDialog =
            new InputDialog(shell, "Subroutine Name", "Name of Subroutine", "", null);
        int returnCode = inputDialog.open();

        // return unless the ok button was pressed
        if (returnCode != Window.OK) { return; }

        String[] result = SourceRefactor.extractMethod(inputDialog.getValue(), selection.getText(),
                getLog());

        if (result.length == 0)
        {
            MessageDialog.openInformation(shell, "Error", "Subroutine could not be generated.");
View Full Code Here

    setPresentsDefaultValue(false);
    String input = list.getItem(index);
    if (index < 0)
      return;

    InputDialog dialog =
      new InputDialog(
        getShell(),
        "Edit Environment Variable",
        "Environment Variable",
        input,
        null);
    int returnCode = dialog.open();

    if (returnCode == Window.OK)
    {
      input = dialog.getValue();
    } else
      return;

    if (input != null)
    {
View Full Code Here

   * @return a new item
   */
  String getNewInputObject()
  {

    InputDialog dialog =
      new InputDialog(
        getShell(),
        "Add Environment Variable",
        "Environment Variable",
        null,
        null);
    int returnCode = dialog.open();

    if (returnCode == Window.OK)
    {

      return (dialog.getValue());

    }
    return (null);
  }
View Full Code Here

        String selection = ((TextSelection) editor.getSelectionProvider().getSelection()).getText();
        Shell shell = PerlEditorPlugin.getWorkbenchWindow().getShell();

        if (selection.length() == 0)
        {
            InputDialog inputDialog =
                new InputDialog(shell, PopupMessages.getString("PerlDoc.search.title"),
                    PopupMessages.getString("PerlDoc.search.message"), "", null);

            int returnCode = inputDialog.open();

            if (returnCode == Window.OK)
            {
                selection = inputDialog.getValue();
            }
            else
            {
                return;
            }
View Full Code Here

   
    // 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

        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

   */
  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

TOP

Related Classes of org.eclipse.jface.dialogs.InputDialog

Copyright © 2018 www.massapicom. 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.