use of org.eclipse.debug.core.ILaunchManager in project statecharts by Yakindu.
the class StatechartLaunchShortcut method createNewLaunchConfiguration.
protected ILaunchConfiguration createNewLaunchConfiguration(IFile file) {
final ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
final ILaunchConfigurationType configType = launchManager.getLaunchConfigurationType(getConfigType());
try {
ILaunchConfigurationWorkingCopy newConfig = configType.newInstance(null, launchManager.generateLaunchConfigurationName(file.getName()));
newConfig.setAttribute(FILE_NAME, file.getFullPath().toString());
return newConfig.doSave();
} catch (CoreException e) {
e.printStackTrace();
}
throw new IllegalStateException();
}
use of org.eclipse.debug.core.ILaunchManager in project azure-tools-for-java by Microsoft.
the class MavenExecuteAction method createLaunchConfiguration.
private ILaunchConfiguration createLaunchConfiguration(IContainer basedir) {
try {
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType launchConfigurationType = launchManager.getLaunchConfigurationType(MavenLaunchConstants.LAUNCH_CONFIGURATION_TYPE_ID);
String launchSafeGoalName = goalName.replace(':', '-');
ILaunchConfigurationWorkingCopy workingCopy = launchConfigurationType.newInstance(null, launchSafeGoalName);
workingCopy.setAttribute(MavenLaunchConstants.ATTR_POM_DIR, basedir.getLocation().toOSString());
workingCopy.setAttribute(MavenLaunchConstants.ATTR_GOALS, goalName);
workingCopy.setAttribute(IDebugUIConstants.ATTR_PRIVATE, true);
workingCopy.setAttribute(RefreshTab.ATTR_REFRESH_SCOPE, "${project}");
workingCopy.setAttribute(RefreshTab.ATTR_REFRESH_RECURSIVE, true);
setProjectConfiguration(workingCopy, basedir);
IPath path = getJREContainerPath(basedir);
if (path != null) {
workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, path.toPortableString());
}
return workingCopy;
} catch (CoreException ex) {
}
return null;
}
use of org.eclipse.debug.core.ILaunchManager in project bndtools by bndtools.
the class AbstractLaunchShortcut method getLaunchConfigsForProject.
protected ILaunchConfiguration[] getLaunchConfigsForProject(@SuppressWarnings("unused") IProject project) {
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType type = manager.getLaunchConfigurationType(launchId);
try {
ILaunchConfiguration[] all = manager.getLaunchConfigurations(type);
List<ILaunchConfiguration> result = new ArrayList<ILaunchConfiguration>(all.length);
return result.toArray(new ILaunchConfiguration[0]);
} catch (CoreException e) {
logger.logError("Error retrieving launch configurations.", e);
return null;
}
}
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;
}
use of org.eclipse.debug.core.ILaunchManager in project jbosstools-hibernate by jbosstools.
the class HibernateConsolePlugin method stopListeningForConfigurations.
private void stopListeningForConfigurations() {
final ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
launchManager.removeLaunchConfigurationListener(icl);
KnownConfigurations.getInstance().removeConfigurationListener(kcl);
}
Aggregations