org.eclipse.xtext.ui.editor.findrefs
Interface IReferenceFinder

All Known Implementing Classes:
DefaultReferenceFinder

public interface IReferenceFinder

Finds cross-references to elements specified by their URIs. References can be from other resources or local. To be referrable from another resource, an element has to be indexed. By default, the index keeps track of such cross resource references. See DefaultResourceDescriptionStrategy for details on the indexing process. Local references are usually not indexed, and they don't have to be as the scope provider usually takes local elements into account. This is why the reference finder needs an IReferenceFinder.ILocalResourceAccess if such local references should be found, too.

Since:
2.3
Author:
Jan Koehnlein - Initial contribution and API

Nested Class Summary
static interface IReferenceFinder.ILocalResourceAccess
          Provides safe read access to a resource set for searching local references.
 
Method Summary
 void findAllReferences(java.lang.Iterable<org.eclipse.emf.common.util.URI> targetURIs, IReferenceFinder.ILocalResourceAccess localResourceAccess, IAcceptor<IReferenceDescription> referenceAcceptor, org.eclipse.core.runtime.IProgressMonitor monitor)
          Finds all references to the given targetURIs.
 void findReferences(java.lang.Iterable<org.eclipse.emf.common.util.URI> targetURIs, java.lang.Iterable<org.eclipse.emf.common.util.URI> sourceResourceURIs, IReferenceFinder.ILocalResourceAccess localResourceAccess, IAcceptor<IReferenceDescription> referenceAcceptor, org.eclipse.core.runtime.IProgressMonitor monitor)
          Finds all references from an iterable of source resources to the given targetURIs.
 

Method Detail

findReferences

void findReferences(java.lang.Iterable<org.eclipse.emf.common.util.URI> targetURIs,
                    java.lang.Iterable<org.eclipse.emf.common.util.URI> sourceResourceURIs,
                    IReferenceFinder.ILocalResourceAccess localResourceAccess,
                    IAcceptor<IReferenceDescription> referenceAcceptor,
                    org.eclipse.core.runtime.IProgressMonitor monitor)
Finds all references from an iterable of source resources to the given targetURIs.

Parameters:
targetURIs - the URIs of the target elements of the references. Should be normalized.
sourceResourceURIs - the search scope for the resources containing the sources of the references.
localResourceAccess - used to find local references. If null, only indexed references are returned.
referenceAcceptor - accepts the matches.
monitor - the progress monitor. Can be null.

findAllReferences

void findAllReferences(java.lang.Iterable<org.eclipse.emf.common.util.URI> targetURIs,
                       IReferenceFinder.ILocalResourceAccess localResourceAccess,
                       IAcceptor<IReferenceDescription> referenceAcceptor,
                       org.eclipse.core.runtime.IProgressMonitor monitor)
Finds all references to the given targetURIs.

Parameters:
targetURIs - the URIs of the target elements of the references. Should be normalized.
localResourceAccess - used to find local references. If null, only indexed references are returned.
referenceAcceptor - accepts the matches.
monitor - the progress monitor. Can be null.