Package org.eclipse.ui.dialogs

Examples of org.eclipse.ui.dialogs.ElementListSelectionDialog


    int flags = ModelElementLabelProvider.SHOW_DEFAULT
        | ModelElementLabelProvider.SHOW_QUALIFIED
        | ModelElementLabelProvider.SHOW_ROOT;

    ElementListSelectionDialog dialog = new ElementListSelectionDialog(
        shell, new ModelElementLabelProvider(flags));
    dialog.setTitle(title);
    dialog.setMessage(message);
    dialog.setElements(elements);

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


    int flags = ModelElementLabelProvider.SHOW_DEFAULT
        | ModelElementLabelProvider.SHOW_QUALIFIED
        | ModelElementLabelProvider.SHOW_ROOT;

    ElementListSelectionDialog dialog = new ElementListSelectionDialog(
        shell, new ModelElementLabelProvider(flags));
    dialog.setTitle(title);
    dialog.setMessage(message);
    dialog.setElements(elements);

    if (dialog.open() == Window.OK) {
      Object[] selection = dialog.getResult();
      if (selection != null && selection.length > 0) {
        nResults = selection.length;
        for (int i = 0; i < nResults; i++) {
          Object current = selection[i];
          if (current instanceof ISourceModule)
View Full Code Here

   * specified launch configurations. Return the chosen config, or
   * <code>null</code> if the user cancelled the dialog.
   */
  protected ILaunchConfiguration chooseConfiguration(List<ILaunchConfiguration> configList) {
    IDebugModelPresentation labelProvider = DebugUITools.newDebugModelPresentation();
    ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider);
    dialog.setElements(configList.toArray());
    dialog.setTitle(LangUIMessages.LaunchShortcut_selectLaunch_title);
    dialog.setMessage(LangUIMessages.LaunchShortcut_selectLaunch_message);
    dialog.setMultipleSelection(false);
    int result = dialog.open();
    labelProvider.dispose();
    if (result == Window.OK) {
      return (ILaunchConfiguration) dialog.getFirstResult();
    }
    return null;
  }
View Full Code Here

    }
    return ArrayUtil.createFrom(list, IResource.class);
  }
 
  protected IResource chooseLaunchable(IResource[] scripts) {
    ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), new WorkbenchLabelProvider());
    dialog.setElements(scripts);
    dialog.setTitle(LangUIMessages.LaunchShortcut_selectLaunchableToLaunch);
    dialog.setMessage(LangUIMessages.LaunchShortcut_selectLaunchableToLaunch);
    if (dialog.open() == Window.OK) {
      return (IResource) dialog.getResult()[0];
    }
    return null;
  }
View Full Code Here

   * specified launch configurations. Return the chosen config, or
   * <code>null</code> if the user cancelled the dialog.
   */
  protected ILaunchConfiguration chooseConfiguration(List<ILaunchConfiguration> configList) {
    IDebugModelPresentation labelProvider = DebugUITools.newDebugModelPresentation();
    ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider);
    dialog.setElements(configList.toArray());
    dialog.setTitle(LangUIMessages.LaunchShortcut_selectLaunch_title);
    dialog.setMessage(LangUIMessages.LaunchShortcut_selectLaunch_message);
    dialog.setMultipleSelection(false);
    int result = dialog.open();
    labelProvider.dispose();
    if (result == Window.OK) {
      return (ILaunchConfiguration) dialog.getFirstResult();
    }
    return null;
  }
View Full Code Here

    }
    return ArrayUtil.createFrom(list, ILaunchTarget.class);
  }
 
  protected ILaunchTarget chooseLaunchable(ILaunchTarget[] launchTargets) {
    ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), createLaunchTargetLabelProvider());
    dialog.setElements(launchTargets);
    dialog.setTitle(LangUIMessages.LaunchShortcut_selectLaunchableToLaunch);
    dialog.setMessage(LangUIMessages.LaunchShortcut_selectLaunchableToLaunch);
    if (dialog.open() == Window.OK) {
      return (ILaunchTarget) dialog.getResult()[0];
    }
    return null;
  }
View Full Code Here

    setFieldValue(project.getName());
  }
 
  protected IProject chooseProject() {
    Shell shell = projectSelectionButton.getShell();
    ElementListSelectionDialog dialog = new ElementListSelectionDialog(shell, new WorkbenchLabelProvider());
    dialog.setTitle(LangUIMessages.projectField_chooseProject_title);
    dialog.setMessage(LangUIMessages.projectField_chooseProject_message);

    try {
      final IProject[] projects = getDialogChooseElements();
      dialog.setElements(projects);
    } catch (CoreException ce) {
      LangUIPlugin.logStatus(ce);
    }
   
    final IProject project = getProject();
    if (project != null && project.isOpen()) {
      dialog.setInitialSelections(new Object[] { project });
    }
   
    if (dialog.open() == Window.OK) {
      return (IProject) dialog.getFirstResult();
    }
   
    return null;
  }
View Full Code Here

  protected void openProgramPathDialog(IProject project) {
    // TODO: this should be refactored to show only main packages
   
    try {
     
      ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), new LabelProvider() {
        @Override
        public String getText(Object element) {
          GoPackageName goPackageName = (GoPackageName) element;
          return goPackageName.getFullNameAsString();
        }
      });
      dialog.setTitle("Select Go main package");
      dialog.setMessage("Select Go main package");
     
      GoEnvironment goEnv = GoProjectEnvironment.getGoEnvironment(project);
      Collection<GoPackageName> sourcePackages = GoProjectEnvironment.getSourcePackages(project, goEnv);
     
      dialog.setElements(ArrayUtil.createFrom(sourcePackages));
     
      if (dialog.open() == IDialogConstants.OK_ID) {
        GoPackageName goPackageName = (GoPackageName) dialog.getFirstResult();
        String packageResourcePath = goPackageName.getFullNameAsString();
       
        if(!GoProjectEnvironment.isProjectInsideGoPath(project, goEnv.getGoPath())) {
          packageResourcePath = "src/" + packageResourcePath;
        } else {
View Full Code Here

  protected EObject selectElement(EObject[] elements) {
    Shell shell = Display.getCurrent().getActiveShell();
    ILabelProvider labelProvider = new AdapterFactoryLabelProvider(
        Fd2DiagramEditorPlugin.getInstance()
            .getItemProvidersAdapterFactory());
    ElementListSelectionDialog dialog = new ElementListSelectionDialog(
        shell, labelProvider);
    dialog.setMessage(Messages.Fd2ModelingAssistantProviderMessage);
    dialog.setTitle(Messages.Fd2ModelingAssistantProviderTitle);
    dialog.setMultipleSelection(false);
    dialog.setElements(elements);
    EObject selected = null;
    if (dialog.open() == Window.OK) {
      selected = (EObject) dialog.getFirstResult();
    }
    return selected;
  }
View Full Code Here

        project = getProject();
        Assert.isNotNull(project);
       
        final Shell p = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
        ILabelProvider labelRenderer  = new ArrayLabelProvider();
        ElementListSelectionDialog dialog = new ElementListSelectionDialog(p, labelRenderer);
       
        List<String[]> input = getInput();
        dialog.setElements(input.toArray());
        dialog.setMultipleSelection(true);
        dialog.setTitle(getTitle());
        dialog.setMessage("Wildcardsearch enabled");
       
        if (dialog.open() == Window.OK) {
            Object[] result = dialog.getResult();
            for (int i = 0; i < result.length; i++) {
                String[] ss = (String[])result[i];
                insertText(ss[1]);
            }
        }
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.