本文整理汇总了Java中org.eclipse.jdt.internal.core.search.matching.MatchLocator类的典型用法代码示例。如果您正苦于以下问题:Java MatchLocator类的具体用法?Java MatchLocator怎么用?Java MatchLocator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MatchLocator类属于org.eclipse.jdt.internal.core.search.matching包,在下文中一共展示了MatchLocator类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: search
import org.eclipse.jdt.internal.core.search.matching.MatchLocator; //导入依赖的package包/类
public boolean search(Index index, IProgressMonitor progressMonitor) {
if (index == null) return COMPLETE;
if (progressMonitor != null && progressMonitor.isCanceled()) throw new OperationCanceledException();
ReadWriteMonitor monitor = index.monitor;
if (monitor == null) return COMPLETE; // index got deleted since acquired
try {
monitor.enterRead(); // ask permission to read
long start = System.currentTimeMillis();
MatchLocator.findIndexMatches(this.pattern, index, this.requestor, this.participant, this.scope, progressMonitor);
this.executionTime += System.currentTimeMillis() - start;
return COMPLETE;
} catch (IOException e) {
if (e instanceof java.io.EOFException)
e.printStackTrace();
return FAILED;
} finally {
monitor.exitRead(); // finished reading
}
}
示例2: locateMatches
import org.eclipse.jdt.internal.core.search.matching.MatchLocator; //导入依赖的package包/类
public void locateMatches(SearchDocument[] indexMatches, SearchPattern pattern,
IJavaSearchScope scope, SearchRequestor requestor, IProgressMonitor monitor) throws CoreException {
MatchLocator matchLocator =
new MatchLocator(
pattern,
requestor,
scope,
monitor
);
/* eliminating false matches and locating them */
if (monitor != null && monitor.isCanceled()) throw new OperationCanceledException();
matchLocator.locateMatches(indexMatches);
}