Examples of ILaunchConfiguration


Examples of org.eclipse.debug.core.ILaunchConfiguration

     *
     * @param type Type for which a configuration is launched
     * @param mode Run/debug mode
     */
    protected void launch(IType type, String mode) {
        ILaunchConfiguration config = findLaunchConfiguration(type, mode);
        if (config != null) {
            DebugUITools.launch(config, mode);
        }
    }
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfiguration

        List candidateConfigs = Collections.EMPTY_LIST;
        try {
            ILaunchConfiguration[] configs = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations(configType);
            candidateConfigs = new ArrayList(configs.length);
            for (int i = 0; i < configs.length; i++) {
                ILaunchConfiguration config = configs[i];
                if (config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "").equals(
                        type.getFullyQualifiedName())) { //$NON-NLS-1$
                    if (config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, "").equals(
                            type.getJavaProject().getElementName())) { //$NON-NLS-1$
                        candidateConfigs.add(config);
                    }
                }
            }
        } catch (CoreException e) {
            ProsePlugin.log(e);
        }

        // If there are no existing configs associated with the IType, create one.
        // If there is exactly one config associated with the IType, return it.
        // Otherwise, if there is more than one config associated with the IType, prompt the
        // user to choose one.
        int candidateCount = candidateConfigs.size();
        if (candidateCount < 1) {
            return createConfiguration(type);
        } else if (candidateCount == 1) {
            return (ILaunchConfiguration) candidateConfigs.get(0);
        } else {
            // Prompt the user to choose a config.  A null result means the user
            // cancelled the dialog, in which case this method returns null,
            // since cancelling the dialog should also cancel launching anything.
            ILaunchConfiguration config = chooseConfiguration(candidateConfigs, mode);
            if (config != null) { return config; }
        }

        return null;
    }
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfiguration

     *
     * @param type Type for which a new configuration is created
     * @return New configuration
     */
    protected ILaunchConfiguration createConfiguration(IType type) {
        ILaunchConfiguration config = null;
        ILaunchConfigurationWorkingCopy wc = null;
        try {
            ILaunchConfigurationType configType = getProseLaunchConfigType();
            wc = configType.newInstance(null, getLaunchManager().generateUniqueLaunchConfigurationNameFrom(type.getElementName()));
        } catch (CoreException exception) {
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfiguration

    @Override
    protected ISourceContainer[] createSourceContainers() throws CoreException {
        List<ISourceContainer> result = new LinkedList<ISourceContainer>();

        ILaunchConfiguration config = getLaunchConfiguration();
        Project project = LaunchUtils.getBndProject(config);
        if (project != null) {
            try {
                Collection<Container> runbundles = project.getRunbundles();
                for (Container runbundle : runbundles) {
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfiguration

    }

    protected void launch(IPath targetPath, String mode) {
        IPath tp = targetPath.makeRelative();
        try {
            ILaunchConfiguration config = findLaunchConfig(tp);
            if (config == null) {
                ILaunchConfigurationWorkingCopy wc = createConfiguration(tp);
                config = wc.doSave();
            }
            DebugUITools.launch(config, mode);
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfiguration

        ILaunchConfigurationType configType = manager.getLaunchConfigurationType(launchId);
        ILaunchConfiguration[] configs = manager.getLaunchConfigurations(configType);

        for (int i = 0; i < configs.length; i++) {
            ILaunchConfiguration config = configs[i];
            String configTargetName = config.getAttribute(LaunchConstants.ATTR_LAUNCH_TARGET, (String) null);
            if (configTargetName != null && configTargetName.equals(targetPath.toString())) {
                candidateConfigs.add(config);
            }
        }
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfiguration

      return;
    }

    for (ILaunch launch : launches)
    {
      ILaunchConfiguration conf = launch.getLaunchConfiguration();
      try
      {
        String pluginId = conf.getType().getPluginIdentifier();

        if (JUnitCorePlugin.getPluginId().equals(pluginId))
        {
          if (addJavaAgentVmArg(conf))
          {
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfiguration

    @Override
    protected void launchJavaElement(IJavaElement element, String mode) throws CoreException {
        IPath projectPath = element.getJavaProject().getProject().getFullPath().makeRelative();

        ILaunchConfiguration config = findLaunchConfig(projectPath);
        if (config == null) {
            ILaunchConfigurationWorkingCopy wc = createConfiguration(projectPath);
            wc.doSave();

            customise(element, wc);
            config = wc;
        } else {
            ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
            customise(element, wc);
            config = wc;
        }
        DebugUITools.launch(config, mode);
    }
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfiguration

    }

    protected void launch(IPath targetPath, String mode) {
        IPath tp = targetPath.makeRelative();
        try {
            ILaunchConfiguration config = findLaunchConfig(tp);
            if (config == null) {
                ILaunchConfigurationWorkingCopy wc = createConfiguration(tp);
                config = wc.doSave();
            }
            DebugUITools.launch(config, mode);
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfiguration

        ILaunchConfigurationType configType = manager.getLaunchConfigurationType(launchId);
        ILaunchConfiguration[] configs = manager.getLaunchConfigurations(configType);

        for (int i = 0; i < configs.length; i++) {
            ILaunchConfiguration config = configs[i];
            String configTargetName = config.getAttribute(LaunchConstants.ATTR_LAUNCH_TARGET, (String) null);
            if (configTargetName != null && configTargetName.equals(targetPath.toString())) {
                candidateConfigs.add(config);
            }
        }
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.