Search in sources :

Example 66 with ILaunchManager

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();
}
Also used : CoreException(org.eclipse.core.runtime.CoreException) ILaunchConfigurationType(org.eclipse.debug.core.ILaunchConfigurationType) ILaunchManager(org.eclipse.debug.core.ILaunchManager) ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)

Example 67 with ILaunchManager

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;
}
Also used : IPath(org.eclipse.core.runtime.IPath) CoreException(org.eclipse.core.runtime.CoreException) ILaunchConfigurationType(org.eclipse.debug.core.ILaunchConfigurationType) ILaunchManager(org.eclipse.debug.core.ILaunchManager) ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)

Example 68 with ILaunchManager

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;
    }
}
Also used : ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) CoreException(org.eclipse.core.runtime.CoreException) ILaunchConfigurationType(org.eclipse.debug.core.ILaunchConfigurationType) ArrayList(java.util.ArrayList) ILaunchManager(org.eclipse.debug.core.ILaunchManager)

Example 69 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)

Example 70 with ILaunchManager

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);
}
Also used : ILaunchManager(org.eclipse.debug.core.ILaunchManager)

Aggregations

ILaunchManager (org.eclipse.debug.core.ILaunchManager)78 ILaunchConfigurationType (org.eclipse.debug.core.ILaunchConfigurationType)53 ILaunchConfigurationWorkingCopy (org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)41 ILaunchConfiguration (org.eclipse.debug.core.ILaunchConfiguration)37 CoreException (org.eclipse.core.runtime.CoreException)28 ArrayList (java.util.ArrayList)15 ILaunch (org.eclipse.debug.core.ILaunch)14 IPath (org.eclipse.core.runtime.IPath)9 File (java.io.File)7 HashMap (java.util.HashMap)6 Path (org.eclipse.core.runtime.Path)6 IProject (org.eclipse.core.resources.IProject)5 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)5 IOException (java.io.IOException)4 Map (java.util.Map)4 IStatus (org.eclipse.core.runtime.IStatus)4 LinkedList (java.util.LinkedList)3 Status (org.eclipse.core.runtime.Status)3 IProcess (org.eclipse.debug.core.model.IProcess)3 IProcess2 (org.talend.core.model.process.IProcess2)3