Examples of InputDialog


Examples of org.eclipse.jface.dialogs.InputDialog

     * 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

Examples of org.eclipse.jface.dialogs.InputDialog

      }

      @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

Examples of org.eclipse.jface.dialogs.InputDialog

        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

Examples of org.eclipse.jface.dialogs.InputDialog

        saveAllButton.setImage(saveAllImg);
        saveAllButton.setToolTipText(Messages.PointPropertiesEditor_17);
        saveAllButton.addSelectionListener(new SelectionAdapter(){
            public void widgetSelected( SelectionEvent e ) {
                String newStyleName = Messages.PointPropertiesEditor_18;
                InputDialog iDialog = new InputDialog(saveAllButton.getShell(), Messages.PointPropertiesEditor_19,
                        Messages.PointPropertiesEditor_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

Examples of org.eclipse.jface.dialogs.InputDialog

        saveAllButton.setImage(saveAllImg);
        saveAllButton.setToolTipText(Messages.LinePropertiesEditor_17);
        saveAllButton.addSelectionListener(new SelectionAdapter(){
            public void widgetSelected( SelectionEvent e ) {
                String newStyleName = Messages.LinePropertiesEditor_18;
                InputDialog iDialog = new InputDialog(saveAllButton.getShell(), Messages.LinePropertiesEditor_19,
                        Messages.LinePropertiesEditor_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

Examples of org.eclipse.jface.dialogs.InputDialog

   */
  public static String getUserName(Shell parent){
    String title = Messages.InternationalizedDialog_Title;
    String message = Messages.InternationalizedDialog_Prompt;
    String name = System.getenv("user.name"); //$NON-NLS-1$
    InputDialog prompt = new InputDialog(
      parent,
      title,
      message,
      name,
      new IInputValidator(){
        public String isValid(String name) {
          return name.length() > 2 ? name : null;
        }     
    });   
    if( prompt.open() == Window.OK ){
      return prompt.getValue();
    }
    return null; // user pressed cancel   
  }
View Full Code Here

Examples of org.eclipse.jface.dialogs.InputDialog

        }

        @Override
        protected String getNewInputObject() {
            String str = null;
            InputDialog dialog = new InputDialog(Display.getCurrent().getActiveShell(),
                    Messages.TileSet_dialog_new_title, Messages.TileSet_dialog_new_desc, str, null);
            int result = dialog.open();
            if (result == Window.OK) {
                str = dialog.getValue();
            }
            if (str == null || "".equals(str)) { //$NON-NLS-1$
                return null; // nothing to add
            }
View Full Code Here

Examples of org.eclipse.jface.dialogs.InputDialog

    private void processRenameFolder() {

        final Runnable runnable = new Runnable() {
            public void run() {
                final Folder folder = (Folder) selection.getFirstElement();
                final InputDialog dialog = new InputDialog(Display.getDefault().getActiveShell(),
                        Messages.RenameFolderAction_dialogTitle,
                        Messages.RenameFolderAction_dialogMsg, folder.getName(), null);
                final int folderNameDialogResult = dialog.open();
                if (folderNameDialogResult == Dialog.OK) {
                    folder.setName(dialog.getValue());
                }
                viewer.refresh();
            }
        };
View Full Code Here

Examples of org.eclipse.jface.dialogs.InputDialog

                    } else {
                        bounds = new ReferencedEnvelope(env, v.getCRS());
                    }
                    MapReference ref = bmManager.getMapReference(map);
                    Bookmark bookmark = new Bookmark(bounds, ref, null);
                    InputDialog dialog = new InputDialog(
                            Display.getCurrent().getActiveShell(),
                            Messages.BookmarkAction_dialogtitle_bookmarklocation,
                            Messages.BookmarkAction_dialogprompt_enterbookmarkname,
                            bookmark.getName(), null);
                    dialog.open();
                    if (dialog.getReturnCode() == Window.OK) {
                        String name = dialog.getValue();
                        bookmark.setName(name);
                        bmManager = BookmarksPlugin.getBookmarkService();
                        bmManager.addBookmark(bookmark);
                        refreshView();
                    }
                    ((BookmarksView) view)
                            .selectReveal(new StructuredSelection(bookmark));
                }
            } else if (RENAME_BOOKMARK_ACTION_ID.equals(action.getId())) {
                IBookmark bookmark = (IBookmark) selection.getFirstElement();
                InputDialog dialog = new InputDialog(Display.getCurrent()
                        .getActiveShell(),
                        Messages.BookmarkAction_dialogtitle_renamebookmark,
                        Messages.BookmarkAction_dialogprompt_enterbookmarkname,
                        bookmark.getName(), null);
                dialog.open();
                if (dialog.getReturnCode() == Window.OK) {
                    String name = dialog.getValue();
                    bookmark.setName(name);
                    refreshView();
                }
            } else if (SAVE_BOOKMARKS_ACTION_ID.equals(action.getId())) {
                BookmarksPlugin.getDefault().storeToPreferences();
View Full Code Here

Examples of org.eclipse.jface.dialogs.InputDialog

                            if (object instanceof JGrassMapGeoResource) {
                                JGrassMapGeoResource mr = (JGrassMapGeoResource) object;
                                File oldMapFile = mr.getMapFile();
                                String oldMapName = oldMapFile.getName();

                                InputDialog iDialog = new InputDialog(shell, "New map name",
                                        "Please enter the new name for the map: " + oldMapName, oldMapName + "_new", null);
                                iDialog.open();
                                String newMapName = iDialog.getValue();
                                if (newMapName != null && newMapName.length() > 0) {
                                    newMapName = newMapName.replaceAll("\\s+", "_");

                                    JGrassMapEnvironment oldMapEnvironment = new JGrassMapEnvironment(oldMapFile);
                                    JGrassRegion jGrassRegion = oldMapEnvironment.getActiveRegion();
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.