Package org.eclipse.jface.dialogs

Examples of org.eclipse.jface.dialogs.InputDialog


                else
                    return null;
            }
        };

        InputDialog dialog = new InputDialog(
            getShell(),
            Messages.getString( "RenameAction.RenameSearchDialog" ), Messages.getString( "RenameAction.RenameSearchNewName" ), search.getName(), validator ); //$NON-NLS-1$ //$NON-NLS-2$

        dialog.open();
        String newName = dialog.getValue();
        if ( newName != null )
        {
            search.setName( newName );
        }
    }
View Full Code Here


                else
                    return null;
            }
        };

        InputDialog dialog = new InputDialog(
            getShell(),
            Messages.getString( "RenameAction.RenameBookmarkDialog" ), Messages.getString( "RenameAction.RenameBookmarkNewName" ), bookmark.getName(), validator ); //$NON-NLS-1$ //$NON-NLS-2$

        dialog.open();
        String newName = dialog.getValue();
        if ( newName != null )
        {
            bookmark.setName( newName );
        }
    }
View Full Code Here

                    return null;
                }
            }
        };

        InputDialog dialog = new InputDialog(
            getShell(),
            Messages.getString( "RenameAction.RenameConnection" ), Messages.getString( "RenameAction.NewNameConnection" ), connection.getName(), //$NON-NLS-1$ //$NON-NLS-2$
            validator );

        dialog.open();
        String newName = dialog.getValue();
        if ( newName != null )
        {
            connection.setName( newName );
        }
    }
View Full Code Here

                    return null;
                }
            }
        };

        InputDialog dialog = new InputDialog(
            getShell(),
            Messages.getString( "RenameAction.RenameConnectionFolder" ), Messages.getString( "RenameAction.NewNameConnectionFolder" ), connectionFolder.getName(), //$NON-NLS-1$ //$NON-NLS-2$
            validator );

        dialog.open();
        String newName = dialog.getValue();
        if ( newName != null )
        {
            connectionFolder.setName( newName );
        }
    }
View Full Code Here

  @Override
  public void preWindowOpen() {
    ReInjector.getInstance().reInject(this);
    boolean connected = false;
    while (!connected) {
      InputDialog inputDialog = new InputDialog(new Shell(),
          Messages.ApplicationWorkbenchWindowAdvisor_HostTitle,
          Messages.ApplicationWorkbenchWindowAdvisor_HostDescription,
          Messages.ApplicationWorkbenchWindowAdvisor_HostDefault,
          null);
      inputDialog.open();
      if (inputDialog.getReturnCode() == InputDialog.OK) {
        connected = getGameClient().connectToServer(
            inputDialog.getValue());
      } else {
        new MessageDialog(
            new Shell(),
            Messages.ApplicationWorkbenchWindowAdvisor_ConnectionFailedTitle,
            null,
View Full Code Here

    return City.class;
  }

  @Override
  public void execute(Object tile) {
    InputDialog inputDialog = new InputDialog(new Shell(),
        Messages.CreateUnitTileAction_NumerOfUnitsTitle,
        Messages.CreateUnitTileAction_NumberOfUnitsQuestion,
        Messages.CreateUnitTileAction_NumberOfUnitDefault,
        new IInputValidator() {
          @Override
          public String isValid(String newText) {
            try {
              int parseInt = Integer.parseInt(newText);
              if (parseInt <= 0) {
                return Messages.CreateUnitTileAction_Warning;
              }
            } catch (Exception e) {
              return Messages.CreateUnitTileAction_Warning2;
            }
            return null;
          }
        });
    if (inputDialog.open() == InputDialog.OK) {
      clientService.execute(new CreateUnitCommand(playerService
          .getDynasty(userService.getUser()), (City) tile, Integer
          .parseInt(inputDialog.getValue())));
    }
  }
View Full Code Here

                if (selectionIndex != -1)
                {
                    final CompositeData selectedLogger = (CompositeData)_table.getItem(
                                                                        selectionIndex).getData();
                    String user = selectedLogger.get(USERNAME).toString();
                    InputDialog id = new InputDialog(setPasswordButton.getShell(),"Set Password",
                                        "Please enter the new password for '" + user + "':",null,null){
                        @Override
                        protected Control createDialogArea(Composite parent)
                        {
                            Control control = super.createDialogArea(parent);
                            //set the Text field echo char to '*' to mask the password
                            getText().setEchoChar('*');
                            //return the normal result
                            return control;
                        }
                    };
                   
                    int returnValue;
                    while((returnValue = id.open()) == InputDialog.OK)
                    {
                        if (id.getValue() == null || id.getValue().toString().length() == 0)
                        {                           
                            ViewUtility.popupErrorMessage("Set Password", "Please enter a valid password");                      
                        }
                        else
                        {
                            break;
                        }
                    }
                   
                    if (returnValue  == InputDialog.OK)
                    {
                        char[] password = id.getValue().toCharArray();

                        // Qpid JMX API 1.1 and below expects the password to be sent as a hashed value.
                        if (_ApiVersion.lessThanOrEqualTo(1,1))
                        {
                            try
                            {
                                password = ViewUtility.getHash(id.getValue());
                            }
                            catch (Exception hashException)
                            {
                                ViewUtility.popupErrorMessage("Set Password",
                                        "Unable to calculate hash for Password:"
View Full Code Here

     * Opens a dialog asking the user for a new name.
     *
     * @return The new name of the element.
     */
    private String getNewName( String oldName ) {
        InputDialog dialog = new InputDialog(Display.getDefault().getActiveShell(),
                Messages.Rename_enterNewName, "", oldName, null); //$NON-NLS-1$
        int result = dialog.open();
        if (result == Dialog.CANCEL)
            return oldName;
        return dialog.getValue();
    }
View Full Code Here

      }

      @Override
      protected String getNewInputObject(){
         String str = new String("image/")
         InputDialog dialog = new InputDialog(
                        Display.getCurrent().getActiveShell(),
                        "New Image Type",
                        "Enter the image type",
                        str,
                        null
         );
         int result = dialog.open();        
         if(result == Window.OK){
            str = dialog.getValue();
         }
         if( "image/".equals( str )){
             return null; // nothing to add
         }
         return str;
View Full Code Here

        saveAllButton.setImage(saveAllImg);
        saveAllButton.setToolTipText(Messages.PolygonPropertiesEditor_17);
        saveAllButton.addSelectionListener(new SelectionAdapter(){
            public void widgetSelected( SelectionEvent e ) {
                String newStyleName = Messages.PolygonPropertiesEditor_18;
                InputDialog iDialog = new InputDialog(saveAllButton.getShell(), Messages.PolygonPropertiesEditor_19,
                        Messages.PolygonPropertiesEditor_20, newStyleName, null);
                iDialog.setBlockOnOpen(true);
                int open = iDialog.open();
                if (open == SWT.CANCEL) {
                    return;
                }
                String name = iDialog.getValue();
                if (name == null || name.length() == 0) {
                    name = newStyleName;
                }
                styleWrapper.setName(name);
                try {
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.