org.eclipse.cdt.debug.internal.core.sourcelookup
Class CProjectSourceLocation

java.lang.Object
  extended by org.eclipse.cdt.debug.internal.core.sourcelookup.CProjectSourceLocation
All Implemented Interfaces:
ICSourceLocation, IProjectSourceLocation, org.eclipse.core.runtime.IAdaptable

public class CProjectSourceLocation
extends java.lang.Object
implements IProjectSourceLocation

Locates source elements in a Java project. Returns instances of IFile.

Since:
Sep 23, 2002

Constructor Summary
CProjectSourceLocation()
          Constructor for CProjectSourceLocation.
CProjectSourceLocation(org.eclipse.core.resources.IProject project)
          Constructor for CProjectSourceLocation.
CProjectSourceLocation(org.eclipse.core.resources.IProject project, boolean generated)
          Constructor for CProjectSourceLocation.
 
Method Summary
 void dispose()
           
 boolean equals(java.lang.Object obj)
           
 java.lang.Object findSourceElement(java.lang.String name)
          Returns an object representing the source code for a file with the specified name, or null if none could be found.
 java.lang.Object getAdapter(java.lang.Class adapter)
           
 java.lang.String getMemento()
          Returns a memento for this source location from which this source location can be reconstructed.
 org.eclipse.core.resources.IProject getProject()
          Returns the project associated with this source location.
 void initializeFrom(java.lang.String memento)
          Initializes this source location from the given memento.
 boolean isGeneric()
           
 boolean searchForDuplicateFiles()
          Returns whether to search for all source elements, or just the first match.
 void setGenerated(boolean b)
           
 void setSearchForDuplicateFiles(boolean search)
          Sets the value of the 'search for duplicate source files' flag.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CProjectSourceLocation

public CProjectSourceLocation()
Constructor for CProjectSourceLocation.


CProjectSourceLocation

public CProjectSourceLocation(org.eclipse.core.resources.IProject project)
Constructor for CProjectSourceLocation.


CProjectSourceLocation

public CProjectSourceLocation(org.eclipse.core.resources.IProject project,
                              boolean generated)
Constructor for CProjectSourceLocation.

Method Detail

findSourceElement

public java.lang.Object findSourceElement(java.lang.String name)
                                   throws org.eclipse.core.runtime.CoreException
Description copied from interface: ICSourceLocation
Returns an object representing the source code for a file with the specified name, or null if none could be found. The source element returned is implementation specific - for example, a resource, a local file, a zip file entry, etc.

Specified by:
findSourceElement in interface ICSourceLocation
Parameters:
name - the name of the object for which source is being searched for
Returns:
source element
Throws:
org.eclipse.core.runtime.CoreException - if an exception occurs while searching for the specified source element

getAdapter

public java.lang.Object getAdapter(java.lang.Class adapter)
Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable

getProject

public org.eclipse.core.resources.IProject getProject()
Returns the project associated with this source location.

Specified by:
getProject in interface IProjectSourceLocation
Returns:
project

dispose

public void dispose()
Specified by:
dispose in interface ICSourceLocation

getMemento

public java.lang.String getMemento()
                            throws org.eclipse.core.runtime.CoreException
Description copied from interface: ICSourceLocation
Returns a memento for this source location from which this source location can be reconstructed.

Specified by:
getMemento in interface ICSourceLocation
Returns:
a memento for this source location
Throws:
org.eclipse.core.runtime.CoreException - if unable to create a memento

initializeFrom

public void initializeFrom(java.lang.String memento)
                    throws org.eclipse.core.runtime.CoreException
Description copied from interface: ICSourceLocation
Initializes this source location from the given memento.

Specified by:
initializeFrom in interface ICSourceLocation
Parameters:
memento - a memento generated by this source location
Throws:
org.eclipse.core.runtime.CoreException - if unable to initialize this source location

isGeneric

public boolean isGeneric()
Specified by:
isGeneric in interface IProjectSourceLocation

setGenerated

public void setGenerated(boolean b)

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

searchForDuplicateFiles

public boolean searchForDuplicateFiles()
Description copied from interface: ICSourceLocation
Returns whether to search for all source elements, or just the first match.

Specified by:
searchForDuplicateFiles in interface ICSourceLocation
Returns:
whether to search for all source elements, or just the first match

setSearchForDuplicateFiles

public void setSearchForDuplicateFiles(boolean search)
Description copied from interface: ICSourceLocation
Sets the value of the 'search for duplicate source files' flag.

Specified by:
setSearchForDuplicateFiles in interface ICSourceLocation
Parameters:
search - - a value to set

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object