Examples of InputDialog


Examples of ch.mtSystems.jnc.view.dialogs.InputDialog

        AppController.getAppController().getCurrentProject().
            setFlagMainCompilationOnly(item.getText(), item.getChecked());
      }
    } else if(e.getSource() == bAddFlag)
    {
      InputDialog inputDialog = new InputDialog(JNC.getContentComposite().getShell());
      inputDialog.setTitle("New GCJ flag");
      inputDialog.setMessage("GCJ flag to add:");
      String flag = inputDialog.open();
      if(flag == null) return;
     
      AppController.getAppController().getCurrentProject().addGcjFlags(flag, false);
      (new TableItem(tGcjFlags, SWT.NONE)).setText(flag);
    } else if(e.getSource() == bRemoveFlag)
View Full Code Here

Examples of embet.gui.eclipse.dialogs.InputDialog

    defProblemAction = new Action()
    {
      @Override
      public void run()
      {
        InputDialog dialog = new InputDialog( parent.getShell(), Type.PROBLEM,
            parent.getDisplay().getCursorLocation() );
        dialog.open();
        if( dialog.getReturnCode() == Window.OK ) {
          // parse problem description and get back the problem context

//          String problemContextXML = embetClient.submitProblem( null, dialog.getText(), userID );
          getEmbetClient().searchUserContext(userID, dialog.getText());
         
          //            System.out.println( "problemContextXML = " + problemContextXML );

         
//          ContextSelectionDialog cDialog = new ContextSelectionDialog( parent.getShell(), ContextSelectionDialog.Type.Problem,new StringReader( problemContextXML ) );
//          cDialog.open();
          //            System.out.println( "Selected = " + cDialog.getSelectedIDs() );
//          embetClient.submitUserContext( userID, cDialog.getSelectedIDs() );

          try {
            Thread.sleep(500);
          } catch (InterruptedException e) {}
         
          reloadContent();
        }
      }
    };
    defProblemAction.setText( "Define problem" );
    defProblemAction.setToolTipText( "Define a problem using free text" );
    defProblemAction.setImageDescriptor( ImageDescriptor.createFromImage( defProblemImg ) );

    ///////////////
    // Add knowledge

    addKnowledgeAction = new Action()
    {
      @Override
      public void run()
      {
        InputDialog dialog = new InputDialog( parent.getShell(), Type.NOTE,
            parent.getDisplay().getCursorLocation() );
        dialog.open();
        if( dialog.getReturnCode() == Window.OK ) {
         
          String fileName = dialog.getFileName();
          String url = null;
          if( fileName != null && fileName.length() > 0 ) {
            // vlastne poslanie
            File file = new File(fileName);
            long fileLen = file.length();
            if( fileLen > 1024*1024 ) {
              showWarning("Maximum allowed file size is 1 MB.");
              return;
            }
            try {
              byte[] content = new byte[(int)fileLen];           
              FileInputStream fs = new FileInputStream(file);
              fs.read(content);
              fs.close();

              System.out.println( "===== Post =====" );
              String repoUrl = preferences.getString(PreferenceConstants.P_REPOSITORY_URL);
              if( !repoUrl.endsWith("/") ) repoUrl += "/";
              url = RepositoryClientUtility.post( repoUrl, content );
              System.out.println( "Returned ID: " + url );
             
              String ext = file.getName().replaceAll( ".+\\.(?=[a-zA-Z0-9]+)", "" ); // extract extension
              String schema;
              if( ext.toLowerCase().equals( "dispel" ) ) schema = "repo+dispel";
              else schema = "repo";
              url = schema + "://" + url;
             
            } catch (FileNotFoundException e) {
              showWarning("File was not found: " + fileName);
              return;
            } catch (IOException e) {
              showWarning("An error occured during file transfer or registration: " + e.getMessage());
              e.printStackTrace();
              return;
            }
          }
          else
            url = dialog.getURL()// will be null or empty or contain URL
         
          // parse the note description and get back the note context
          String noteContextXML = getEmbetClient().submitNote( null, dialog.getText(), userID, url );

          ContextSelectionDialog cDialog = new ContextSelectionDialog( parent.getShell(),
              ContextSelectionDialog.Type.Note,
              new StringReader( noteContextXML ) );
          cDialog.open();
View Full Code Here

Examples of net.azib.ipscan.gui.InputDialog

      this.feederRegistry = feederRegistry;
    }
   
    public void handleEvent(Event event) {
      String feederInfo = feederRegistry.current().getInfo();
      InputDialog inputDialog = new InputDialog(
          Labels.getLabel("title.favorite.add"),
          Labels.getLabel("text.favorite.add"));
      String favoriteName = inputDialog.open(feederInfo);
     
      if (favoriteName != null) {
        if (favoritesConfig.get(favoriteName) != null) {
          throw new UserErrorException("favorite.alreadyExists");
        }
View Full Code Here

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

Examples of org.eclipse.jface.dialogs.InputDialog

     * 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

Examples of org.eclipse.jface.dialogs.InputDialog

     * 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

Examples of org.eclipse.jface.dialogs.InputDialog

        {
            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

Examples of org.eclipse.jface.dialogs.InputDialog

    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

Examples of org.eclipse.jface.dialogs.InputDialog

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

Examples of org.eclipse.jface.dialogs.InputDialog

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