Package org.eclipse.debug.ui

Examples of org.eclipse.debug.ui.IDebugModelPresentation


     * @param configList Selectable configurations
     * @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


    public IDebugModelPresentation getPresentation(String id) {
        if (getViewer() instanceof StructuredViewer) {
            VariablesViewLabelProvider vvlp = (VariablesViewLabelProvider) ((StructuredViewer) getViewer())
                    .getLabelProvider();
            IDebugModelPresentation lp = vvlp.getPresentation();
            if (lp instanceof DelegatingModelPresentation) {
                return ((DelegatingModelPresentation) lp).getPresentation(id);
            }
            if (lp instanceof LazyModelPresentation) {
                if (((LazyModelPresentation) lp).getDebugModelIdentifier()
View Full Code Here

     * @return ILaunchConfiguration
     * @throws InterruptedException if cancelled by the user
     */
    private ILaunchConfiguration chooseConfiguration(List configList, String mode) throws InterruptedException
    {
        IDebugModelPresentation labelProvider = DebugUITools.newDebugModelPresentation();
        ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider);
        dialog.setElements(configList.toArray());
        dialog.setTitle(JUnitMessages.JUnitLaunchShortcut_message_selectConfiguration);
        if (mode.equals(ILaunchManager.DEBUG_MODE))
        {
View Full Code Here

   * Show a selection dialog that allows the user to choose one of the
   * 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

   * @param mode
   * @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

    }
    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

   * @return configuration to launch or <code>null</code> to cancel
   */
  protected ILaunchConfiguration chooseConfiguration(
      List<ILaunchConfiguration> configList)
  {
    IDebugModelPresentation labelProvider = DebugUITools.newDebugModelPresentation();
    ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider);
    dialog.setElements(configList.toArray());
    dialog.setTitle(getTypeSelectionTitle());
    dialog.setMessage(LauncherMessages.VdmLaunchShortcut_2);
    dialog.setMultipleSelection(false);
    int result = dialog.open();
    labelProvider.dispose();
    if (result == Window.OK)
    {
      return (ILaunchConfiguration) dialog.getFirstResult();
    }
    return null;
View Full Code Here

    return null;
  }

  protected ILaunchConfiguration chooseConfiguration(
      List<ILaunchConfiguration> configList) {
    IDebugModelPresentation labelProvider = DebugUITools
        .newDebugModelPresentation();
    ElementListSelectionDialog dialog = new ElementListSelectionDialog(
        getShell(), labelProvider);
    dialog.setElements(configList.toArray());
    dialog.setTitle("Select launch configuration");
    dialog.setMessage("Select launch configuration...");
    dialog.setMultipleSelection(false);
    int result = dialog.open();
    labelProvider.dispose();
    if (result == Window.OK) {
      return (ILaunchConfiguration) dialog.getFirstResult();
    }
    return null;
  }
View Full Code Here

    }
    return null;
  }
 
  private ILaunchConfiguration chooseConfiguration(List configList, String mode) throws InterruptedException {
    IDebugModelPresentation labelProvider= DebugUITools.newDebugModelPresentation();
    ElementListSelectionDialog dialog= new ElementListSelectionDialog(getShell(), labelProvider);
    dialog.setElements(configList.toArray());
    dialog.setTitle(JUnitMessages.JUnitLaunchShortcut_message_selectConfiguration);
    if (mode.equals(ILaunchManager.DEBUG_MODE)) {
      dialog.setMessage(JUnitMessages.JUnitLaunchShortcut_message_selectDebugConfiguration);
View Full Code Here

        if (matchingConfigs.size() == 1) {
          Activator.getLogger().info("Using existing launch configuration");
          return matchingConfigs.get(0);
        } else if (matchingConfigs.size() > 1) {
          final IDebugModelPresentation labelProvider = DebugUITools
              .newDebugModelPresentation();
          ElementListSelectionDialog dialog = new ElementListSelectionDialog(
              getShell(), //
              new ILabelProvider() {
                @Override
                public Image getImage(Object element) {
                  return labelProvider.getImage(element);
                }

                @Override
                public String getText(Object element) {
                  if (element instanceof ILaunchConfiguration) {
                    ILaunchConfiguration configuration = (ILaunchConfiguration) element;
                    try {
                      return labelProvider
                          .getText(element)
                          + " : "
                          + configuration
                          .getAttribute(
                              MavenLaunchConstants.ATTR_GOALS,
                              "");
                    } catch (CoreException ex) {
                      // ignore
                    }
                  }
                  return labelProvider.getText(element);
                }

                @Override
                public boolean isLabelProperty(Object element,
                    String property) {
                  return labelProvider.isLabelProperty(
                      element, property);
                }

                @Override
                public void addListener(
                    ILabelProviderListener listener) {
                  labelProvider.addListener(listener);
                }

                @Override
                public void removeListener(
                    ILabelProviderListener listener) {
                  labelProvider.removeListener(listener);
                }

                @Override
                public void dispose() {
                  labelProvider.dispose();
                }
              });
          dialog.setElements(matchingConfigs
              .toArray(new ILaunchConfiguration[matchingConfigs
                                                .size()]));
          dialog.setTitle("Select Configuration");
          if (mode.equals(ILaunchManager.DEBUG_MODE)) {
            dialog.setMessage("Select a launch configuration to debug:");
          } else {
            dialog.setMessage("Select a launch configuration to run:");
          }
          dialog.setMultipleSelection(false);
          int result = dialog.open();
          labelProvider.dispose();
          return result == Window.OK ? (ILaunchConfiguration) dialog
              .getFirstResult() : null;
        }

      } catch (CoreException ex) {
View Full Code Here

TOP

Related Classes of org.eclipse.debug.ui.IDebugModelPresentation

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.