Search in sources :

Example 6 with RefactoringSearchEngine2

use of org.eclipse.jdt.internal.corext.refactoring.RefactoringSearchEngine2 in project che by eclipse.

the class MemberVisibilityAdjustor method findReferences.

/**
	 * Finds references to the specified member.
	 * @param member the member
	 * @param monitor the progress monitor to use
	 * @return the search result groups
	 * @throws JavaModelException if an error occurs during search
	 */
private SearchResultGroup[] findReferences(final IMember member, final IProgressMonitor monitor) throws JavaModelException {
    final RefactoringSearchEngine2 engine = new RefactoringSearchEngine2(SearchPattern.createPattern(member, IJavaSearchConstants.REFERENCES, SearchUtils.GENERICS_AGNOSTIC_MATCH_RULE));
    engine.setOwner(fOwner);
    engine.setFiltering(true, true);
    engine.setScope(RefactoringScopeFactory.create(member));
    engine.searchPattern(new SubProgressMonitor(monitor, 1));
    return (SearchResultGroup[]) engine.getResults();
}
Also used : RefactoringSearchEngine2(org.eclipse.jdt.internal.corext.refactoring.RefactoringSearchEngine2) SubProgressMonitor(org.eclipse.core.runtime.SubProgressMonitor)

Aggregations

RefactoringSearchEngine2 (org.eclipse.jdt.internal.corext.refactoring.RefactoringSearchEngine2)6 SubProgressMonitor (org.eclipse.core.runtime.SubProgressMonitor)5 SearchMatch (org.eclipse.jdt.core.search.SearchMatch)3 SearchResultGroup (org.eclipse.jdt.internal.corext.refactoring.SearchResultGroup)3 IType (org.eclipse.jdt.core.IType)2 SearchPattern (org.eclipse.jdt.core.search.SearchPattern)2 IRefactoringSearchRequestor (org.eclipse.jdt.internal.corext.refactoring.IRefactoringSearchRequestor)2 CoreException (org.eclipse.core.runtime.CoreException)1 ICompilationUnit (org.eclipse.jdt.core.ICompilationUnit)1 IMethod (org.eclipse.jdt.core.IMethod)1 IJavaSearchScope (org.eclipse.jdt.core.search.IJavaSearchScope)1 TypeOccurrenceCollector (org.eclipse.jdt.internal.corext.refactoring.rename.TypeOccurrenceCollector)1