1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Renamed 'SourceLocationFactory' to 'SourceLookupFactory'.

Added the 'createSourceLocator' method to 'SourceLookupFactory'.
This commit is contained in:
Mikhail Khodjaiants 2003-10-27 20:06:46 +00:00
parent 60d1a002c7
commit 10c705c445
3 changed files with 20 additions and 7 deletions

View file

@ -1,3 +1,9 @@
2003-10-27 Mikhail Khodjaiants
Renamed 'SourceLocationFactory' to 'SourceLookupFactory'.
Added the 'createSourceLocator' method to 'SourceLookupFactory'.
* SourceLookupFactory.java
* CSourceLocator.java
2003-10-27 Mikhail Khodjaiants
Changed the 'getAdapter' method of 'CSourceManager' to return the adapter of
the 'ICSourceLocator' class.

View file

@ -8,6 +8,8 @@ package org.eclipse.cdt.debug.core.sourcelookup;
import org.eclipse.cdt.debug.internal.core.sourcelookup.CDirectorySourceLocation;
import org.eclipse.cdt.debug.internal.core.sourcelookup.CProjectSourceLocation;
import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceLocator;
import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceManager;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IPath;
@ -16,7 +18,7 @@ import org.eclipse.core.runtime.IPath;
*
* @since Jul 14, 2003
*/
public class SourceLocationFactory
public class SourceLookupFactory
{
public static IProjectSourceLocation createProjectSourceLocation( IProject project )
{
@ -32,4 +34,9 @@ public class SourceLocationFactory
{
return new CDirectorySourceLocation( directory, association, searchSubfolders );
}
public static ICSourceLocator createSourceLocator( IProject project )
{
return new CSourceManager( new CSourceLocator( project ) );
}
}

View file

@ -27,7 +27,7 @@ import org.eclipse.cdt.debug.core.model.IStackFrameInfo;
import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation;
import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator;
import org.eclipse.cdt.debug.core.sourcelookup.IProjectSourceLocation;
import org.eclipse.cdt.debug.core.sourcelookup.SourceLocationFactory;
import org.eclipse.cdt.debug.core.sourcelookup.SourceLookupFactory;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
@ -219,7 +219,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
ArrayList list = new ArrayList();
if ( project != null && project.exists() )
{
list.add( SourceLocationFactory.createProjectSourceLocation( project ) );
list.add( SourceLookupFactory.createProjectSourceLocation( project ) );
addReferencedSourceLocations( list, project );
}
return (ICSourceLocation[])list.toArray( new ICSourceLocation[list.size()] );
@ -236,7 +236,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
{
if ( projects[i].exists() && !containsProject( list, projects[i] ) )
{
list.add( SourceLocationFactory.createProjectSourceLocation( projects[i] ) );
list.add( SourceLookupFactory.createProjectSourceLocation( projects[i] ) );
addReferencedSourceLocations( list, projects[i] );
}
}
@ -656,12 +656,12 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
Iterator it = fReferencedProjects.iterator();
ArrayList list = new ArrayList( fReferencedProjects.size() );
if ( getProject() != null && getProject().exists() && getProject().isOpen() )
list.add( SourceLocationFactory.createProjectSourceLocation( getProject() ) );
list.add( SourceLookupFactory.createProjectSourceLocation( getProject() ) );
while( it.hasNext() )
{
IProject project = (IProject)it.next();
if ( project != null && project.exists() && project.isOpen() )
list.add( SourceLocationFactory.createProjectSourceLocation( project ) );
list.add( SourceLookupFactory.createProjectSourceLocation( project ) );
}
return (ICSourceLocation[])list.toArray( new ICSourceLocation[list.size()] );
}
@ -721,7 +721,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
{
IProject project = (IProject)it.next();
if ( !fReferencedProjects.contains( project ) )
newLocations.add( SourceLocationFactory.createProjectSourceLocation( project ) );
newLocations.add( SourceLookupFactory.createProjectSourceLocation( project ) );
}
fReferencedProjects = newRefs;
setSourceLocations( (ICSourceLocation[])newLocations.toArray( new ICSourceLocation[newLocations.size()] ) );