Class JavaSourceLocator
java.lang.Object
org.eclipse.jdt.launching.sourcelookup.JavaSourceLocator
- All Implemented Interfaces:
org.eclipse.debug.core.model.IPersistableSourceLocator,org.eclipse.debug.core.model.ISourceLocator
@Deprecated
public class JavaSourceLocator
extends Object
implements org.eclipse.debug.core.model.IPersistableSourceLocator
Deprecated.
Locates source for a Java debug session by searching
a configurable set of source locations.
This class may be instantiated.
- Since:
- 2.0
- See Also:
- Restriction:
- This class is not intended to be sub-classed by clients.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.Identifier for the 'Java Source Locator' extension (value"org.eclipse.jdt.launching.javaSourceLocator"). -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Constructs a new empty JavaSourceLocator.JavaSourceLocator(IJavaProject project) Deprecated.Constructs a new JavaSourceLocator that searches the default set of source locations for the given Java project.JavaSourceLocator(IJavaProject[] projects, boolean includeRequired) Deprecated.Constructs a new Java source locator that looks in the specified project for source, and required projects, ifincludeRequiredistrue.JavaSourceLocator(IJavaSourceLocation[] locations) Deprecated.Constructs a new JavaSourceLocator that searches the specified set of source locations for source elements. -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidcollectRequiredProjects(IJavaProject proj, ArrayList<IJavaProject> res) Deprecated.Adds all projects required byprojto the listresstatic IJavaSourceLocation[]getDefaultSourceLocations(IJavaProject project) Deprecated.Returns a default collection of source locations for the given Java project.Deprecated.getSourceElement(org.eclipse.debug.core.model.IStackFrame stackFrame) Deprecated.Object[]getSourceElements(org.eclipse.debug.core.model.IStackFrame stackFrame) Deprecated.Returns all source elements that correspond to the type associated with the given stack frame, ornullif none.Deprecated.Returns the locations that this source locator is currently searching, in the order that they are searched.voidinitializeDefaults(org.eclipse.debug.core.ILaunchConfiguration configuration) Deprecated.voidinitializeFromMemento(String memento) Deprecated.voidsetSourceLocations(IJavaSourceLocation[] locations) Deprecated.Sets the locations that will be searched, in the order to be searched.
-
Field Details
-
ID_JAVA_SOURCE_LOCATOR
Deprecated.Identifier for the 'Java Source Locator' extension (value"org.eclipse.jdt.launching.javaSourceLocator").
-
-
Constructor Details
-
JavaSourceLocator
public JavaSourceLocator()Deprecated.Constructs a new empty JavaSourceLocator. -
JavaSourceLocator
public JavaSourceLocator(IJavaProject[] projects, boolean includeRequired) throws org.eclipse.core.runtime.CoreException Deprecated.Constructs a new Java source locator that looks in the specified project for source, and required projects, ifincludeRequiredistrue.- Parameters:
projects- the projects in which to look for sourceincludeRequired- whether to look in required projects as well- Throws:
org.eclipse.core.runtime.CoreException- if a new locator fails to be created
-
JavaSourceLocator
Deprecated.Constructs a new JavaSourceLocator that searches the specified set of source locations for source elements.- Parameters:
locations- the source locations to search for source, in the order they should be searched
-
JavaSourceLocator
Deprecated.Constructs a new JavaSourceLocator that searches the default set of source locations for the given Java project.- Parameters:
project- Java project- Throws:
org.eclipse.core.runtime.CoreException- if an exception occurs reading the classpath of the given or any required project
-
-
Method Details
-
setSourceLocations
Deprecated.Sets the locations that will be searched, in the order to be searched.- Parameters:
locations- the locations that will be searched, in the order to be searched
-
getSourceLocations
Deprecated.Returns the locations that this source locator is currently searching, in the order that they are searched.- Returns:
- the locations that this source locator is currently searching, in the order that they are searched
-
getSourceElements
Deprecated.Returns all source elements that correspond to the type associated with the given stack frame, ornullif none.- Parameters:
stackFrame- stack frame- Returns:
- all source elements that correspond to the type associated with
the given stack frame, or
nullif none - Since:
- 2.1
-
getSourceElement
Deprecated.- Specified by:
getSourceElementin interfaceorg.eclipse.debug.core.model.ISourceLocator
-
collectRequiredProjects
protected static void collectRequiredProjects(IJavaProject proj, ArrayList<IJavaProject> res) throws JavaModelException Deprecated.Adds all projects required byprojto the listres- Parameters:
proj- the project for which to compute required projectsres- the list to add all required projects too- Throws:
JavaModelException- if there is a problem with the backing Java model
-
getDefaultSourceLocations
public static IJavaSourceLocation[] getDefaultSourceLocations(IJavaProject project) throws org.eclipse.core.runtime.CoreException Deprecated.Returns a default collection of source locations for the given Java project. Default source locations consist of the given project and all of its required projects .- Parameters:
project- Java project- Returns:
- a collection of source locations for all required projects
- Throws:
org.eclipse.core.runtime.CoreException- if an exception occurs reading computing the default locations
-
getMemento
Deprecated.- Specified by:
getMementoin interfaceorg.eclipse.debug.core.model.IPersistableSourceLocator- Throws:
org.eclipse.core.runtime.CoreException
-
initializeDefaults
public void initializeDefaults(org.eclipse.debug.core.ILaunchConfiguration configuration) throws org.eclipse.core.runtime.CoreException Deprecated.- Specified by:
initializeDefaultsin interfaceorg.eclipse.debug.core.model.IPersistableSourceLocator- Throws:
org.eclipse.core.runtime.CoreException
-
initializeFromMemento
Deprecated.- Specified by:
initializeFromMementoin interfaceorg.eclipse.debug.core.model.IPersistableSourceLocator- Throws:
org.eclipse.core.runtime.CoreException
-
org.eclipse.debug.core.sourcelookupandorg.eclipse.debug.core.sourcelookup.containers. This class has been replaced by a Java source lookup director and Java source lookup participant. To migrate to the new source lookup support clients should add two new attributes to their launch configuration type extensions:- sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"
- sourcePathComputerId="org.eclipse.jdt.launching.sourceLookup.javaSourcePathComputer"
The source locator id attribute specifies to use the Java source lookup director for launch configurations of the associated type, and the source path computer id attribute specifies the class to use when computing a default source lookup path for a launch configuration. The path computer referenced/provided (by the above id), computes a default source lookup path based on the support provided in the 2.0 release - i.e. a configuration'sATTR_SOURCE_PATH_PROVIDERattribute (if present), or a default source lookup path based on a configuration's runtime classpath. This class has been replaced by the Java source lookup director which is an internal class, but can be used via thesourceLocatorIdattribute on a launch configuration type extension.