Examples of ElementListSelectionDialog


Examples of org.eclipse.ui.dialogs.ElementListSelectionDialog

   * 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

Examples of org.eclipse.ui.dialogs.ElementListSelectionDialog

      JDIDebugUIPlugin.log(e);
      projects= new IJavaProject[0];
    }
   
    ILabelProvider labelProvider= new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT);
    ElementListSelectionDialog dialog= new ElementListSelectionDialog(getShell(), labelProvider);
    dialog.setTitle("Project Select"); //$NON-NLS-1$
    dialog.setMessage("Choose a project to constrain the search for behaviour type"); //$NON-NLS-1$
    dialog.setElements(projects);
   
    IJavaProject javaProject = getJavaProject();
    if (javaProject != null) {
      dialog.setInitialSelections(new Object[] { javaProject });
    }
    if (dialog.open() == Window.OK) {     
      return (IJavaProject) dialog.getFirstResult();
    }     
    return null;   
  }
View Full Code Here

Examples of org.eclipse.ui.dialogs.ElementListSelectionDialog

   * @return ILaunchConfiguration
   * @throws LaunchCancelledByUserException
   */
  protected ILaunchConfiguration chooseConfiguration(List configList, String mode) throws LaunchCancelledByUserException {
    IDebugModelPresentation labelProvider = DebugUITools.newDebugModelPresentation();
    ElementListSelectionDialog dialog= new ElementListSelectionDialog(JBehavePlugin.getActiveWorkbenchShell(), labelProvider);
    dialog.setElements(configList.toArray());
    dialog.setTitle("Select JBehave Configuration");
    if (mode.equals(ILaunchManager.DEBUG_MODE)) {
      dialog.setMessage("Select JBehave debug configuration");
    } else {
      dialog.setMessage("Select JBehave run configuration");
    }
    dialog.setMultipleSelection(false);
    int result= dialog.open();
    labelProvider.dispose();
    if (result == Window.OK) {
      return (ILaunchConfiguration)dialog.getFirstResult();
    }
    throw new LaunchCancelledByUserException();
  }
View Full Code Here

Examples of org.eclipse.ui.dialogs.ElementListSelectionDialog

    scBand8.addSelectionListener(bandAdapter);
    scBand9.addSelectionListener(bandAdapter);   
  }
 
  private String getSelectedPreset() {
    ElementListSelectionDialog dialog = new ElementListSelectionDialog(_shell, new LabelProvider());
    dialog.setTitle(Messages.getString("EqualizerView.PresetSelectTitle")); //$NON-NLS-1$
    dialog.setMessage(Messages.getString("EqualizerView.PresetSelectMessage")); //$NON-NLS-1$
    dialog.setMultipleSelection(false);
    dialog.setElements(Controller.getInstance().getEqualizerController().getPresetsList());
    int result = dialog.open();
   
    if (result == Dialog.OK) {
      return (String) dialog.getFirstResult();
    } else {
      return null;
    }
  }
View Full Code Here

Examples of org.eclipse.ui.dialogs.ElementListSelectionDialog

    fillToolsMenu(menuBar);
    fillHelpMenu(menuBar);
  }
 
  private String getPerspectiveId(final IWorkbenchWindow window, String title, String message) {
    ElementListSelectionDialog dialog = new ElementListSelectionDialog(window.getShell(), new LabelProvider());   
    dialog.setTitle(title);
    dialog.setMessage(message); //$NON-NLS-1$
    dialog.setMultipleSelection(false);
   
    List<String> perspectiveList = new ArrayList<String>();
    IPerspectiveDescriptor[] perspectiveArray = PlatformUI.getWorkbench().getPerspectiveRegistry().getPerspectives();
    for (int i = 0; i < perspectiveArray.length; i++) {
      perspectiveList.add(perspectiveArray[i].getLabel());
    }   
    dialog.setElements(perspectiveList.toArray());
   
    int result = dialog.open();
   
    if (result == Dialog.OK) {
      return (String) dialog.getFirstResult();
    } else {
      return null;
    }
  }
View Full Code Here

Examples of org.eclipse.ui.dialogs.ElementListSelectionDialog

    return config;
  }
   
  private ILaunchConfiguration chooseConfiguration(ILaunchConfiguration[] configs) {
    IDebugModelPresentation labelProvider = DebugUITools.newDebugModelPresentation();
    ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider);
    dialog.setElements(configs);
    dialog.setTitle("Choose configuration");
    if (fMode.equals(ILaunchManager.DEBUG_MODE)) {
      dialog.setMessage("Debug...");
    } else {
      dialog.setMessage("Run...");
    }
    dialog.setMultipleSelection(false);
    int result = dialog.open();
    labelProvider.dispose();
    if (result == Window.OK) {
      return (ILaunchConfiguration) dialog.getFirstResult();
    }
    return null;
  }
View Full Code Here

Examples of org.eclipse.ui.dialogs.ElementListSelectionDialog

        break;
      case 1:
        moduleFile = modules.get(0);
        break;
      default:
        ElementListSelectionDialog dialog = new ElementListSelectionDialog(new Shell(), new GwtLabelProvider());
        dialog.setMultipleSelection(false);
        dialog.setTitle("Module Selection");
        dialog.setMessage("Select the module to launch:");
        dialog.setElements(modules.toArray());
        dialog.open();
        moduleFile = (IFile) dialog.getFirstResult();
      }
    } catch (CoreException e) {
      Activator.logException(e);
      ErrorDialog.openError(new Shell(), "Error launching", "An exception occured while launching GWT Hosted mode", e.getStatus());
      moduleFile = null;
View Full Code Here

Examples of org.eclipse.ui.dialogs.ElementListSelectionDialog

      // Do nothing
    }
    if (packages == null)
      packages = new IJavaElement[0];

    ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), new JavaElementLabelProvider(
        JavaElementLabelProvider.SHOW_DEFAULT));
    dialog.setTitle(J2EEUIMessages.PACKAGE_SELECTION_DIALOG_TITLE);
    dialog.setMessage(J2EEUIMessages.PACKAGE_SELECTION_DIALOG_DESC);
    dialog.setEmptyListMessage(J2EEUIMessages.PACKAGE_SELECTION_DIALOG_MSG_NONE);
    dialog.setElements(packages);
    if (dialog.open() == Window.OK) {
      IPackageFragment fragment = (IPackageFragment) dialog.getFirstResult();
      if (fragment != null) {
        packageText.setText(fragment.getElementName());
      } else {
        packageText.setText(J2EEUIMessages.EMPTY_STRING);
      }
View Full Code Here

Examples of org.eclipse.ui.dialogs.ElementListSelectionDialog

      // Do nothing
    }
    if (packages == null)
      packages = new IJavaElement[0];

    ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), new JavaElementLabelProvider(
        JavaElementLabelProvider.SHOW_DEFAULT));
    dialog.setTitle(J2EEUIMessages.PACKAGE_SELECTION_DIALOG_TITLE);
    dialog.setMessage(J2EEUIMessages.PACKAGE_SELECTION_DIALOG_DESC);
    dialog.setEmptyListMessage(J2EEUIMessages.PACKAGE_SELECTION_DIALOG_MSG_NONE);
    dialog.setElements(packages);
    if (dialog.open() == Window.OK) {
      IPackageFragment fragment = (IPackageFragment) dialog.getFirstResult();
      if (fragment != null) {
        packageText.setText(fragment.getElementName());
      } else {
        packageText.setText(J2EEUIMessages.EMPTY_STRING);
      }
View Full Code Here

Examples of org.eclipse.ui.dialogs.ElementListSelectionDialog

    } catch (JavaModelException e) {
      // Do nothing
    }
    if (packages == null)
      packages = new IJavaElement[0];
    ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), new JavaElementLabelProvider(1));
    dialog.setTitle(WizardConstants.PACKAGE_SELECTION_DIALOG_TITLE);
    dialog.setMessage(WizardConstants.PACKAGE_SELECTION_DIALOG_DESC);
    dialog.setEmptyListMessage(WizardConstants.PACKAGE_SELECTION_DIALOG_MSG_NONE);
    dialog.setElements(packages);
    if (dialog.open() == Window.OK) {
      IPackageFragment fragment = (IPackageFragment) dialog.getFirstResult();
      if (fragment != null) {
        packageText.setText(fragment.getElementName());
      } else {
        packageText.setText("EMPTY_STRING");
      }
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.