1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-08 08:45:44 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2010-12-01 22:51:10 +00:00
parent 49067335fd
commit e19da24804

View file

@ -6,8 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
* Nokia - Added support for AbsoluteSourceContainer( 159833 )
* QNX Software Systems - Initial API and implementation
* Nokia - Added support for AbsoluteSourceContainer(159833)
*******************************************************************************/
package org.eclipse.cdt.debug.internal.core.sourcelookup;
@ -43,35 +43,35 @@ public class CSourcePathComputerDelegate implements ISourcePathComputerDelegate
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourcePathComputerDelegate#computeSourceContainers(org.eclipse.debug.core.ILaunchConfiguration, org.eclipse.core.runtime.IProgressMonitor)
*/
public ISourceContainer[] computeSourceContainers( ILaunchConfiguration configuration, IProgressMonitor monitor ) throws CoreException {
public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException {
// First, get all the the containers in the global preferences (but add them last)
ISourceContainer[] common = CDebugCorePlugin.getDefault().getCommonSourceLookupDirector().getSourceContainers();
List<ISourceContainer> containers = new ArrayList<ISourceContainer>( common.length + 2 );
List<ISourceContainer> containers = new ArrayList<ISourceContainer>(common.length + 2);
// Add a container that fetches files that are specified with an absolute path
containers.add(new AbsolutePathSourceContainer() );
containers.add(new AbsolutePathSourceContainer());
// Add a container that fetches files that are specified with a program relative path
containers.add(new ProgramRelativePathSourceContainer());
// Add a container that looks in the project specified in the configuration
String projectName = configuration.getAttribute( ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String)null );
String projectName = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String) null);
if (projectName != null && projectName.length() > 0) {
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject( projectName );
if ( project.exists() ) {
containers.add(new ProjectSourceContainer( project, true ) );
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
if (project.exists()) {
containers.add(new ProjectSourceContainer(project, true));
}
}
// Finally, add the common (global) containers
for ( ISourceContainer sc : common ) {
for (ISourceContainer sc : common) {
// If the container is a path-mapper, use a copy (why?)
if ( sc.getType().getId().equals( MappingSourceContainer.TYPE_ID ) )
if (sc.getType().getId().equals(MappingSourceContainer.TYPE_ID))
sc = ((MappingSourceContainer)sc).copy();
containers.add( sc );
containers.add(sc);
}
return containers.toArray( new ISourceContainer[containers.size()] );
return containers.toArray(new ISourceContainer[containers.size()]);
}
}