Package org.eclipse.ui.dialogs

Examples of org.eclipse.ui.dialogs.ElementListSelectionDialog


    }
    if (packages == null) {
      packages = new IJavaElement[0];
    }

    ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), new JavaElementLabelProvider(
        JavaElementLabelProvider.SHOW_DEFAULT));
    dialog.setIgnoreCase(false);
    dialog.setTitle("Package Selection");
    dialog.setMessage("&Choose a folder:");
    dialog.setEmptyListMessage("Cannot find packages to select.");
    dialog.setElements(packages);
    IPackageFragment pack = getPackageFragment();
    if (pack != null) {
      dialog.setInitialSelections(new Object[] { pack});
    }

    if (dialog.open() == Window.OK) {
      return (IPackageFragment) dialog.getFirstResult();
    }
    return null;
  }
View Full Code Here


     * @param mode Run/debug mode
     * @return Launch configuration
     */
    protected ILaunchConfiguration chooseConfiguration(List configList, String mode) {
        IDebugModelPresentation labelProvider = DebugUITools.newDebugModelPresentation();
        ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider);
        dialog.setElements(configList.toArray());
        dialog.setTitle("Launch Configuration Selection");
        if (mode.equals(ILaunchManager.DEBUG_MODE)) {
            dialog.setMessage("Choose a launch configuration to debug");
        } else {
            dialog.setMessage("Choose a launch configuration to run");
        }
        dialog.setMultipleSelection(false);
        int result = dialog.open();
        labelProvider.dispose();
        if (result == Window.OK) { return (ILaunchConfiguration) dialog.getFirstResult(); }
        return null;
    }
View Full Code Here

            ProsePlugin.log(e.getStatus());
            projects = new IJavaProject[0];
        }

        ILabelProvider labelProvider = new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT);
        ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider);
        dialog.setTitle("Project Selection");
        dialog.setMessage("Choose a project to constrain the search for main types:");
        dialog.setElements(projects);

        IJavaProject javaProject = getJavaProject();
        if (javaProject != null) {
            dialog.setInitialSelections(new Object[] { javaProject});
        }
        if (dialog.open() == ElementListSelectionDialog.OK) { return (IJavaProject) dialog.getFirstResult(); }
        return null;
    }
View Full Code Here

        return projectGroup;
    }

    void doBrowseProject() {
        ElementListSelectionDialog dialog = new ElementListSelectionDialog(launchTargetTxt.getShell(), new WorkbenchLabelProvider());
        dialog.setTitle("Project Selection");

        dialog.setMessage("Select a project to constrain your search.");

        List<IProject> projects = loadProjects();
        dialog.setElements(projects.toArray(new IProject[projects.size()]));

        if (Window.OK == dialog.open()) {
            IProject selected = (IProject) dialog.getFirstResult();
            launchTargetTxt.setText(selected.getName());
        }
    }
View Full Code Here

        }
        if (packages == null) {
            packages = new IJavaElement[0];
        }

        ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT));
        dialog.setIgnoreCase(false);
        dialog.setTitle(NewWizardMessages.NewTypeWizardPage_ChoosePackageDialog_title);
        dialog.setMessage(NewWizardMessages.NewTypeWizardPage_ChoosePackageDialog_description);
        dialog.setEmptyListMessage(NewWizardMessages.NewTypeWizardPage_ChoosePackageDialog_empty);
        dialog.setElements(packages);
        dialog.setHelpAvailable(false);

        IPackageFragment pack = getPackageFragment();
        if (pack != null) {
            dialog.setInitialSelections(new Object[] {
                pack
            });
        }

        if (dialog.open() == Window.OK) {
            return (IPackageFragment) dialog.getFirstResult();
        }
        return null;
    }
View Full Code Here

  private class ButtonListener extends SelectionAdapter {
    public void widgetSelected(SelectionEvent e) {
      String[] files = getPerlFiles();

      ILabelProvider labelProvider = new FileLabelProvider();
      ElementListSelectionDialog dialog = new ElementListSelectionDialog(
          getShell(), labelProvider);
      dialog.setTitle("File Selection");
      dialog.setMessage("Matching files:");
      dialog.setElements(files);

      String perlFile = fMainText.getText();
      if (perlFile != null) {
        dialog.setInitialSelections(new Object[] { perlFile });
      }
      if (dialog.open() == ElementListSelectionDialog.OK) {
        fMainText.setText((String) dialog.getFirstResult());
      }
    }
View Full Code Here

                  }
                  selectionOptions.add(option);
                  index.put(option, String.valueOf(i));
                }
               
                ElementListSelectionDialog dialog = new ElementListSelectionDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), new LabelProvider());
                dialog.setTitle(TITLE);
                dialog.setMessage(DESCRIPTION);
                dialog.setElements(selectionOptions.toArray());


                if (dialog.open() != Window.OK) {  
                  if (dialog.getReturnCode() == Window.CANCEL){
                    CloudFoundryPlugin.logWarning("User pressed cancel on selection dialog"); //$NON-NLS-1$
                    return null;
                  }
                  CloudFoundryPlugin.logError(("Failed to open the Open Home Page selection dialog")); //$NON-NLS-1$
                  return null;
                }

                Object[] result = dialog.getResult();
                contextRoot = cfs.getLaunchableModuleContextRoot(launchables[Integer.valueOf(index.get(result[0]))]);
              }
            }
          }
         
View Full Code Here

              injector.inject(document, viewer, offset);
            } else if (types.length > 1) {
             
              Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
             
              ElementListSelectionDialog dialog = new ElementListSelectionDialog(shell, new TypeLabelProvider());
              dialog.setElements(types);
             
              if (dialog.open() == Window.OK) {
               
                Object[] result = dialog.getResult();
               
                if (result != null && result.length == 1) {
                  this.type = (IType) result[0];
                  UseStatementInjector injector = new UseStatementInjector(this);
                  injector.inject(document, viewer, offset);
View Full Code Here

  private void setUpBrowseProjectDialog() {
    ILabelProvider projectLabelProvider = new BrowseProjectLabelProvider();

    IJavaProject[] javaProjects = javaProjectHelper.getJavaProjects();

    ElementListSelectionDialog dialog =
        new ElementListSelectionDialog(getControl().getShell(), projectLabelProvider);
    dialog.setMessage("Choose a project to run testability on:");

    if (javaProjects != null) {
      dialog.setElements(javaProjects);
    }

    if (dialog.open() == Window.OK) {
      IJavaProject project = (IJavaProject) dialog.getFirstResult();
      projectText.setText(project.getElementName());
      setTabDirty();
    }
  }
View Full Code Here

            CoverageHelper.reportError("Can not save results!");
            return;
        }

        // open dialog
        final ElementListSelectionDialog resDialog = new ElementListSelectionDialog(
                shell, labelProvider);

        resDialog.setElements(dir.listFiles());
        resDialog.setTitle("Restoring results");
        resDialog.setMessage("Select results to restore");

        resDialog.open();

        if (resDialog.getReturnCode() != Window.OK) {
            return;
        }
        //
        final File f = (File) resDialog.getFirstResult();

        try {
            final ObjectInputStream objStream = new ObjectInputStream(
                    new FileInputStream(f));
View Full Code Here

TOP

Related Classes of org.eclipse.ui.dialogs.ElementListSelectionDialog

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.