Interface ISourceLookupDirector
-
- All Superinterfaces:
IPersistableSourceLocator,IPersistableSourceLocator2,ISourceLocator
- All Known Implementing Classes:
AbstractSourceLookupDirector
public interface ISourceLookupDirector extends IPersistableSourceLocator2
A source lookup director directs the source lookup process among a set of participants and source containers.Clients may implement this interface. An abstract implementation is provided by
AbstractSourceLookupDirector, which clients should subclass.- Since:
- 3.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddParticipants(ISourceLookupParticipant[] participants)Adds the given source lookup participants to this director.voidclearSourceElements(Object element)Clears any source lookup results associated with the given debug artifact, such that a subsequent lookup will force a new search to be performed.Object[]findSourceElements(Object object)Returns a collection of source elements corresponding to the given debug artifact (for example, a stack frame or breakpoint).StringgetId()Returns the identifier of this type of source locator.ILaunchConfigurationgetLaunchConfiguration()Returns the launch configuration associated with this source lookup director, ornullif none.ISourceLookupParticipant[]getParticipants()Returns the source lookup participants currently registered with this director, possibly an empty collection.ISourceContainer[]getSourceContainers()Returns the source containers currently registered with this director, possibly an empty collection.ObjectgetSourceElement(Object element)Returns a source element that corresponds to the given debug artifact, ornullif a source element could not be located.ISourcePathComputergetSourcePathComputer()Returns the source path computer to use with this source lookup director, possiblynull.voidinitializeParticipants()Notifies this source lookup director that it should initialize its set of source lookup participants.booleanisFindDuplicates()Returns whether to search exhaustively for all source elements with the same name in all registered source containers, or whether to stop searching when the first source element matching the required name is found.voidremoveParticipants(ISourceLookupParticipant[] participants)Removes the given source lookup participants from this director.voidsetFindDuplicates(boolean findDuplicates)Sets whether to search exhaustively for all source elements with the same name in all registered source containers, or whether to stop searching when the first source element matching the required name is found.voidsetSourceContainers(ISourceContainer[] containers)Sets the source containers this source lookup director should search when looking for source, possibly an empty collection.voidsetSourcePathComputer(ISourcePathComputer computer)Sets the source path computer for this source lookup director.booleansupportsSourceContainerType(ISourceContainerType type)Returns whether this source director supports the given type of source location.-
Methods inherited from interface org.eclipse.debug.core.model.IPersistableSourceLocator
getMemento, initializeDefaults, initializeFromMemento
-
Methods inherited from interface org.eclipse.debug.core.sourcelookup.IPersistableSourceLocator2
dispose, initializeFromMemento
-
Methods inherited from interface org.eclipse.debug.core.model.ISourceLocator
getSourceElement
-
-
-
-
Method Detail
-
getLaunchConfiguration
ILaunchConfiguration getLaunchConfiguration()
Returns the launch configuration associated with this source lookup director, ornullif none.- Returns:
- the launch configuration associated with this source
lookup director, or
nullif none
-
getParticipants
ISourceLookupParticipant[] getParticipants()
Returns the source lookup participants currently registered with this director, possibly an empty collection.- Returns:
- the source lookup participants currently registered with this director, possibly an empty collection
-
getSourceContainers
ISourceContainer[] getSourceContainers()
Returns the source containers currently registered with this director, possibly an empty collection.- Returns:
- the source containers currently registered with this director, possibly an empty collection
-
setSourceContainers
void setSourceContainers(ISourceContainer[] containers)
Sets the source containers this source lookup director should search when looking for source, possibly an empty collection.- Parameters:
containers- the source containers this source lookup director should search when looking for source, possibly an empty collection
-
isFindDuplicates
boolean isFindDuplicates()
Returns whether to search exhaustively for all source elements with the same name in all registered source containers, or whether to stop searching when the first source element matching the required name is found.- Returns:
- whether to search exhaustively for all source elements with the same name
-
setFindDuplicates
void setFindDuplicates(boolean findDuplicates)
Sets whether to search exhaustively for all source elements with the same name in all registered source containers, or whether to stop searching when the first source element matching the required name is found.- Parameters:
findDuplicates- whether to search exhaustively for all source elements with the same name
-
initializeParticipants
void initializeParticipants()
Notifies this source lookup director that it should initialize its set of source lookup participants.
-
supportsSourceContainerType
boolean supportsSourceContainerType(ISourceContainerType type)
Returns whether this source director supports the given type of source location.- Parameters:
type- source container type- Returns:
- whether this source director supports the given type of source location
-
clearSourceElements
void clearSourceElements(Object element)
Clears any source lookup results associated with the given debug artifact, such that a subsequent lookup will force a new search to be performed.- Parameters:
element- debug artifact to clear source lookup results for
-
addParticipants
void addParticipants(ISourceLookupParticipant[] participants)
Adds the given source lookup participants to this director.- Parameters:
participants- participants to add
-
removeParticipants
void removeParticipants(ISourceLookupParticipant[] participants)
Removes the given source lookup participants from this director.- Parameters:
participants- participants to remove
-
getId
String getId()
Returns the identifier of this type of source locator.- Returns:
- the identifier of this type of source locator
-
getSourcePathComputer
ISourcePathComputer getSourcePathComputer()
Returns the source path computer to use with this source lookup director, possiblynull. By default, the source path computer returned is the one associated with this director's launch configuration's type. However, the source path computer can be specified programmatically by callingsetSourcePathComputer(...).- Returns:
- the source path computer to use with this source lookup
director, possibly
null
-
setSourcePathComputer
void setSourcePathComputer(ISourcePathComputer computer)
Sets the source path computer for this source lookup director. This method can be used to override the default source path computer for a launch configuration type. Whennullis specified the default source path computer will be used (i.e. the one associated with this director's launch configuration's type).- Parameters:
computer- source path computer ornull
-
findSourceElements
Object[] findSourceElements(Object object) throws CoreException
Returns a collection of source elements corresponding to the given debug artifact (for example, a stack frame or breakpoint). Returns an empty collection if no source elements are found. This participant's source lookup director specifies if duplicate source elements should be searched for, viaisFindDuplicates(). Whenfalsethe returned collection should contain at most one source element.- Parameters:
object- the debug artifact for which source needs to be found (e.g., stack frame)- Returns:
- a collection of source elements corresponding to the given debug artifact, possibly empty
- Throws:
CoreException- if an exception occurs while searching for source
-
getSourceElement
Object getSourceElement(Object element)
Returns a source element that corresponds to the given debug artifact, ornullif a source element could not be located. This is a generalization ofgetSourceElement(IStackFrame)to allow source to be found for other types of elements.- Parameters:
element- the debug artifact for which to locate source- Returns:
- an object representing a source element.
-
-