Example usage for org.eclipse.jdt.internal.core.search.matching PatternLocator PatternLocator

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

Introduction

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

Prototype

public PatternLocator(SearchPattern pattern) 

Source Link

Usage

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

License:Open Source License

public MatchLocator(SearchPattern pattern, SearchRequestor requestor, IJavaSearchScope scope,
        IProgressMonitor progressMonitor) {

    this.pattern = pattern;
    this.patternLocator = PatternLocator.patternLocator(this.pattern);
    this.matchContainer = this.patternLocator == null ? 0 : this.patternLocator.matchContainer();
    this.requestor = requestor;
    this.scope = scope;
    this.progressMonitor = progressMonitor;
    if (pattern instanceof PackageDeclarationPattern) {
        this.searchPackageDeclaration = true;
    } else if (pattern instanceof OrPattern) {
        this.searchPackageDeclaration = ((OrPattern) pattern).hasPackageDeclaration();
    } else {/* ww w  .  j a  v  a 2 s. com*/
        this.searchPackageDeclaration = false;
    }
}