1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 10:16:03 +02:00

Implementation of source locator.

This commit is contained in:
Mikhail Khodjaiants 2002-09-20 18:35:25 +00:00
parent 734438b514
commit 523331e401

View file

@ -261,17 +261,9 @@ public class CSourceLocator implements ICSourceLocator
} }
return false; return false;
} }
if ( fProject.exists( resource.getFullPath() ) ) if ( resource instanceof IFile )
{ {
return true; return containsFile( resource.getLocation() );
}
IProject[] projects = getReferencedProjects();
for ( int i = 0; i < projects.length; ++i )
{
if ( projects[i].exists( resource.getFullPath() ) )
{
return true;
}
} }
return false; return false;
} }
@ -289,4 +281,23 @@ public class CSourceLocator implements ICSourceLocator
} }
return projects; return projects;
} }
protected boolean containsFile( IPath path )
{
try
{
if ( findFile( (IContainer)fProject, path ) != null )
return true;
IProject[] p = fProject.getReferencedProjects();
for ( int j= 0; j < p.length; j++ )
{
if ( findFile( (IContainer)p[j], path ) != null )
return true;
}
}
catch( CoreException e )
{
}
return false;
}
} }