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;
}
Aggregations