Example usage for org.eclipse.jdt.internal.core.search IndexSelector canSeeFocus

List of usage examples for org.eclipse.jdt.internal.core.search IndexSelector canSeeFocus

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.core.search IndexSelector canSeeFocus.

Prototype

public static int canSeeFocus(SearchPattern pattern, IPath projectOrJarPath) 

Source Link

Document

Returns whether elements of the given project or jar can see the given focus (an IJavaProject or a JarPackageFragmentRot) either because the focus is part of the project or the jar, or because it is accessible throught the project's classpath

Usage

From source file:org.eclipse.jdt.internal.core.search.matching.MatchLocator.java

License:Open Source License

private static HashMap workingCopiesThatCanSeeFocus(org.eclipse.jdt.core.ICompilationUnit[] copies,
        SearchPattern pattern, SearchParticipant participant) {
    if (copies == null)
        return new HashMap();
    HashMap result = new HashMap();
    for (int i = 0, length = copies.length; i < length; i++) {
        org.eclipse.jdt.core.ICompilationUnit workingCopy = copies[i];
        IPath projectOrJar = MatchLocator.getProjectOrJar(workingCopy).getPath();
        if (pattern.focus == null || IndexSelector.canSeeFocus(pattern, projectOrJar)) {
            result.put(workingCopy.getPath().toString(), new WorkingCopyDocument(workingCopy, participant));
        }/*  www.  ja  va2 s.c  o m*/
    }
    return result;
}