Java Code Examples for org.eclipse.debug.core.ILaunchConfiguration#getMappedResources()

The following examples show how to use org.eclipse.debug.core.ILaunchConfiguration#getMappedResources() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PythonConsoleLineTracker.java    From Pydev with Eclipse Public License 1.0 6 votes vote down vote up
private void initLaunchConfiguration(ILaunchConfiguration launchConfiguration) {
    if (launchConfiguration != null) {
        IResource[] mappedResources;
        try {
            mappedResources = launchConfiguration.getMappedResources();
            if (mappedResources != null && mappedResources.length > 0) {
                this.project = mappedResources[0].getProject();
                final PythonNature nature = PythonNature.getPythonNature(project);
                if (nature != null) {
                    this.workingDirectory = PythonRunnerConfig.getWorkingDirectory(launchConfiguration,
                            nature);
                }
            }
        } catch (Exception e) {
            Log.log(e);
        }
    }
}
 
Example 2
Source File: LaunchEvent.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
public LaunchEvent(ILaunch launch) {
	this.launch = launch;

	ILaunchConfiguration launchConfiguration = launch.getLaunchConfiguration();
	try {
		IResource[] mappedResources = launchConfiguration.getMappedResources();
		for (IResource iResource : mappedResources) {
			launchedFile = iResource.getName();
			launchedProject = iResource.getProject();
		}
	} catch (CoreException e) {
		e.printStackTrace();
	}
}