Package org.eclipse.ui.dialogs

Examples of org.eclipse.ui.dialogs.ElementTreeSelectionDialog.open()


                return true;
            }
        });
        dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
        // TODO try to preselect the current file
        dialog.open();
        Object[] results = dialog.getResult();
        if ((results != null) && (results.length > 0) && (results[0] instanceof IFile)) {
            IPath path = ((IFile) results[0]).getFullPath();
            if (project != null && path.segment(0).equals(project.getProject().getName())) {
                setWorkspaceLoc(path.removeFirstSegments(1).makeRelative().toString());
View Full Code Here


      });
      // configure input and initial selection
      dialog.setInput(JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()));
      dialog.setInitialSelection(initialSelection);
      // open and return result
      if (dialog.open() == Window.OK) {
        return (IPackageFragment) dialog.getFirstResult();
      }
      return null;
    }
  }
View Full Code Here

            dialog.setInitialSelection(compilationUnit);
          }
        }
      }
    }
    if (dialog.open() == Window.OK) {
      Object element = dialog.getFirstResult();
      if (element instanceof ICompilationUnit) {
        ICompilationUnit unit = (ICompilationUnit) element;
        factoryNameField.setText(unit.findPrimaryType().getFullyQualifiedName());
      }
View Full Code Here

            return new Status(IStatus.ERROR, CasEditorPlugin.ID, 0, "Please select a folder!", null);
          }
        });

        folderSelectionDialog.open();

        Object[] results = folderSelectionDialog.getResult();

        if (results != null && results.length > 0) {
          // validator makes sure that an IContainer or an IAdaptable
View Full Code Here

            dialog.setSorter(sorter);
           
            dialog.setInitialSelection(cp.findElement(new Path(pathInArchive)));
           
            dialog.setInput(path);
            if (dialog.open() == Window.OK) {
                String name= provider.getFullPath(dialog.getFirstResult());
                return new Path(name).removeTrailingSeparator().toString();
            }
        } catch (IOException e) {
            WojPlugin.log("Error while reading archive :"+path,e); //$NON-NLS-1$
View Full Code Here

    dialog.setInput(currProject);
    dialog.setComparator(new ResourceComparator(1));
    IResource res = currProject.findMember(initialPath);
    if(res != null)
      dialog.setInitialSelection(res);
    if(dialog.open() == 0)
      return (IFolder)dialog.getFirstResult();
    return null;
  }
 
  protected IStatus componentAPIChanged() {
View Full Code Here

      }
    });
    dialog.setAllowMultiple(false);
    dialog.setTitle(HTMLPlugin.getResourceString("Launcher.JavaScript.Dialog.SelectFile"));
   
    if (dialog.open() == Dialog.OK) {
      IFile file = (IFile) dialog.getFirstResult();
      return file.getLocation().toString();
    }
   
    return null;
View Full Code Here

              return ngStatus;
            }
            return okStatus;
          }
        });
        if (dialog.open() == Dialog.OK) {
          Object[] results = dialog.getResult();
          for(int i=0;i<results.length;i++){
            _tableModel.add(results[i]);
          }
          _tableViewer.refresh();
View Full Code Here

    _addExternal.addSelectionListener(new SelectionAdapter(){
      @Override
      public void widgetSelected(SelectionEvent evt){
        FileDialog dialog = new FileDialog(parent.getShell(), SWT.OPEN|SWT.MULTI);
        dialog.setFilterExtensions(new String[]{"*.js"});
        String result = dialog.open();
        if(result!=null){
          String dir = dialog.getFilterPath();
          String[] fileNames = dialog.getFileNames();
          for(int i=0;i<fileNames.length;i++){
            _tableModel.add(new File(dir, fileNames[i]));
View Full Code Here

                new WorkbenchLabelProvider(), new WorkbenchContentProvider());
        dialog.setTitle(LaunchConfigurationsMessages.CommonTab_13);
        dialog.setMessage(LaunchConfigurationsMessages.CommonTab_14);
        dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
        dialog.setSorter(new ResourceSorter(ResourceSorter.NAME));
        if (dialog.open() == IDialogConstants.OK_ID) {
          IResource resource = (IResource) dialog.getFirstResult();
          String arg = resource.getFullPath().toString();
          String fileLoc = VariablesPlugin.getDefault().getStringVariableManager()
                  .generateVariableExpression("workspace_loc", arg); //$NON-NLS-1$
          fFileText.setText(fileLoc);
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.