Search in sources :

Example 11 with ILaunchManager

use of org.eclipse.debug.core.ILaunchManager in project bndtools by bndtools.

the class AbstractLaunchShortcut method createConfiguration.

protected ILaunchConfigurationWorkingCopy createConfiguration(IPath targetPath, IProject targetProject) throws CoreException {
    ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
    ILaunchConfigurationType configType = manager.getLaunchConfigurationType(launchId);
    ILaunchConfigurationWorkingCopy wc;
    wc = configType.newInstance(null, manager.generateLaunchConfigurationName(targetPath.lastSegment()));
    wc.setAttribute(LaunchConstants.ATTR_LAUNCH_TARGET, targetPath.toString());
    wc.setAttribute(LaunchConstants.ATTR_CLEAN, LaunchConstants.DEFAULT_CLEAN);
    wc.setAttribute(LaunchConstants.ATTR_DYNAMIC_BUNDLES, LaunchConstants.DEFAULT_DYNAMIC_BUNDLES);
    if (targetProject != null) {
        IJavaProject javaProject = JavaCore.create(targetProject);
        if (javaProject.exists()) {
            wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, targetProject.getName());
        }
    }
    return wc;
}
Also used : IJavaProject(org.eclipse.jdt.core.IJavaProject) ILaunchConfigurationType(org.eclipse.debug.core.ILaunchConfigurationType) ILaunchManager(org.eclipse.debug.core.ILaunchManager) ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)

Aggregations

ILaunchManager (org.eclipse.debug.core.ILaunchManager)11 ILaunchConfigurationType (org.eclipse.debug.core.ILaunchConfigurationType)8 ILaunchConfiguration (org.eclipse.debug.core.ILaunchConfiguration)7 ILaunchConfigurationWorkingCopy (org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)5 ArrayList (java.util.ArrayList)3 CoreException (org.eclipse.core.runtime.CoreException)3 ILaunch (org.eclipse.debug.core.ILaunch)3 IProcess2 (org.talend.core.model.process.IProcess2)3 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)2 ProcessItem (org.talend.core.model.properties.ProcessItem)2 Project (org.talend.core.model.properties.Project)2 Property (org.talend.core.model.properties.Property)2 Map (java.util.Map)1 IPath (org.eclipse.core.runtime.IPath)1 Path (org.eclipse.core.runtime.Path)1 IJavaProject (org.eclipse.jdt.core.IJavaProject)1 IRuntimeClasspathEntry (org.eclipse.jdt.launching.IRuntimeClasspathEntry)1 IVMInstall (org.eclipse.jdt.launching.IVMInstall)1 Point (org.eclipse.swt.graphics.Point)1 SaveJobBeforeRunAction (org.talend.designer.runprocess.ui.actions.SaveJobBeforeRunAction)1