1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-08 16:55:38 +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 * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* QNX Software Systems - Initial API and implementation * QNX Software Systems - Initial API and implementation
* Nokia - Added support for AbsoluteSourceContainer( 159833 ) * Nokia - Added support for AbsoluteSourceContainer(159833)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.debug.internal.core.sourcelookup; package org.eclipse.cdt.debug.internal.core.sourcelookup;
@ -43,35 +43,35 @@ public class CSourcePathComputerDelegate implements ISourcePathComputerDelegate
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourcePathComputerDelegate#computeSourceContainers(org.eclipse.debug.core.ILaunchConfiguration, org.eclipse.core.runtime.IProgressMonitor) * @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) // First, get all the the containers in the global preferences (but add them last)
ISourceContainer[] common = CDebugCorePlugin.getDefault().getCommonSourceLookupDirector().getSourceContainers(); 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 // 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 // Add a container that fetches files that are specified with a program relative path
containers.add(new ProgramRelativePathSourceContainer()); containers.add(new ProgramRelativePathSourceContainer());
// Add a container that looks in the project specified in the configuration // 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) { if (projectName != null && projectName.length() > 0) {
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject( projectName ); IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
if ( project.exists() ) { if (project.exists()) {
containers.add(new ProjectSourceContainer( project, true ) ); containers.add(new ProjectSourceContainer(project, true));
} }
} }
// Finally, add the common (global) containers // 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 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(); sc = ((MappingSourceContainer)sc).copy();
containers.add( sc ); containers.add(sc);
} }
return containers.toArray( new ISourceContainer[containers.size()] ); return containers.toArray(new ISourceContainer[containers.size()]);
} }
} }