Example usage for org.eclipse.jdt.internal.core.search.matching MatchLocator getProjectOrJar

List of usage examples for org.eclipse.jdt.internal.core.search.matching MatchLocator getProjectOrJar

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.core.search.matching MatchLocator getProjectOrJar.

Prototype

public static IJavaElement getProjectOrJar(IJavaElement element) 

Source Link

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));
        }//from w ww .  j av a 2 s  .c  om
    }
    return result;
}