当前位置: 首页>>代码示例>>Java>>正文


Java MatchLocator类代码示例

本文整理汇总了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
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:20,代码来源:PatternSearchJob.java

示例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);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:16,代码来源:JavaSearchParticipant.java


注:本文中的org.eclipse.jdt.internal.core.search.matching.MatchLocator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。