diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog index 45e04d3f3bd..f440c86b6fe 100644 --- a/debug/org.eclipse.cdt.debug.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.core/ChangeLog @@ -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. diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/SourceLocationFactory.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/SourceLookupFactory.java similarity index 75% rename from debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/SourceLocationFactory.java rename to debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/SourceLookupFactory.java index c09a581900e..b3e6471443a 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/SourceLocationFactory.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/SourceLookupFactory.java @@ -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 ) ); + } } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLocator.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLocator.java index bff11bee30d..0866a38b71b 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLocator.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLocator.java @@ -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()] ) );