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

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

public class CDirectorySourceLocation
extends java.lang.Object
implements IDirectorySourceLocation

Locates source elements in a directory in the local file system. Returns instances of FileStorage.

Since:
Sep 23, 2002

Constructor Summary
CDirectorySourceLocation()
          Constructor for CDirectorySourceLocation.
CDirectorySourceLocation(org.eclipse.core.runtime.IPath directory, org.eclipse.core.runtime.IPath association, boolean searchSubfolders)
          Constructor for CDirectorySourceLocation.
 
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)
           
 org.eclipse.core.runtime.IPath getAssociation()
           
 org.eclipse.core.runtime.IPath getDirectory()
          Returns the root directory of this source location.
 void getDirectory(org.eclipse.core.runtime.IPath path)
           
 java.lang.String getMemento()
          Returns a memento for this source location from which this source location can be reconstructed.
 void initializeFrom(java.lang.String memento)
          Initializes this source location from the given memento.
 boolean searchForDuplicateFiles()
          Returns whether to search for all source elements, or just the first match.
 boolean searchSubfolders()
           
 void setAssociation(org.eclipse.core.runtime.IPath association)
           
 void setSearchForDuplicateFiles(boolean search)
          Sets the value of the 'search for duplicate source files' flag.
 void setSearchSubfolders(boolean search)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CDirectorySourceLocation

public CDirectorySourceLocation()
Constructor for CDirectorySourceLocation.


CDirectorySourceLocation

public CDirectorySourceLocation(org.eclipse.core.runtime.IPath directory,
                                org.eclipse.core.runtime.IPath association,
                                boolean searchSubfolders)
Constructor for CDirectorySourceLocation.

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

getDirectory

public org.eclipse.core.runtime.IPath getDirectory()
Returns the root directory of this source location.

Specified by:
getDirectory in interface IDirectorySourceLocation
Returns:
directory

getDirectory

public void getDirectory(org.eclipse.core.runtime.IPath path)

setAssociation

public void setAssociation(org.eclipse.core.runtime.IPath association)

getAssociation

public org.eclipse.core.runtime.IPath getAssociation()
Specified by:
getAssociation in interface IDirectorySourceLocation

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

equals

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

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

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

searchSubfolders

public boolean searchSubfolders()
Specified by:
searchSubfolders in interface IDirectorySourceLocation

setSearchSubfolders

public void setSearchSubfolders(boolean search)

toString

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

dispose

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