當前位置: 首頁>>代碼示例>>Java>>正文


Java PatternConstructor類代碼示例

本文整理匯總了Java中org.eclipse.jdt.internal.ui.util.PatternConstructor的典型用法代碼示例。如果您正苦於以下問題:Java PatternConstructor類的具體用法?Java PatternConstructor怎麽用?Java PatternConstructor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PatternConstructor類屬於org.eclipse.jdt.internal.ui.util包,在下文中一共展示了PatternConstructor類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: process

import org.eclipse.jdt.internal.ui.util.PatternConstructor; //導入依賴的package包/類
public static void process(
    QualifiedNameSearchResult result,
    String pattern,
    String newValue,
    String filePatterns,
    IProject root,
    IProgressMonitor monitor) {
  Assert.isNotNull(pattern);
  Assert.isNotNull(newValue);
  Assert.isNotNull(root);

  if (monitor == null) monitor = new NullProgressMonitor();

  if (filePatterns == null || filePatterns.length() == 0) {
    // Eat progress.
    monitor.beginTask("", 1); // $NON-NLS-1$
    monitor.worked(1);
    return;
  }

  ResultCollector collector = new ResultCollector(result, newValue);
  TextSearchEngine engine = TextSearchEngine.create();
  Pattern searchPattern = PatternConstructor.createPattern(pattern, true, false);

  engine.search(createScope(filePatterns, root), collector, searchPattern, monitor);
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:27,代碼來源:QualifiedNameFinder.java

示例2: process

import org.eclipse.jdt.internal.ui.util.PatternConstructor; //導入依賴的package包/類
public static void process(QualifiedNameSearchResult result, String pattern, String newValue, String filePatterns, IProject root, IProgressMonitor monitor) {
	Assert.isNotNull(pattern);
	Assert.isNotNull(newValue);
	Assert.isNotNull(root);

	if (monitor == null)
		monitor= new NullProgressMonitor();

	if (filePatterns == null || filePatterns.length() == 0) {
		// Eat progress.
		monitor.beginTask("", 1); //$NON-NLS-1$
		monitor.worked(1);
		return;
	}

	ResultCollector collector= new ResultCollector(result, newValue);
	TextSearchEngine engine= TextSearchEngine.create();
	Pattern searchPattern= PatternConstructor.createPattern(pattern, true, false);

	engine.search(createScope(filePatterns, root), collector, searchPattern, monitor);
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:22,代碼來源:QualifiedNameFinder.java

示例3: getFilePattern

import org.eclipse.jdt.internal.ui.util.PatternConstructor; //導入依賴的package包/類
private static Pattern getFilePattern(String filePatterns) {
  StringTokenizer tokenizer = new StringTokenizer(filePatterns, ","); // $NON-NLS-1$
  String[] filePatternArray = new String[tokenizer.countTokens()];
  int i = 0;
  while (tokenizer.hasMoreTokens()) {
    filePatternArray[i++] = tokenizer.nextToken().trim();
  }
  return PatternConstructor.createPattern(filePatternArray, true, false);
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:10,代碼來源:QualifiedNameFinder.java

示例4: getFilePattern

import org.eclipse.jdt.internal.ui.util.PatternConstructor; //導入依賴的package包/類
private static Pattern getFilePattern(String filePatterns) {
	StringTokenizer tokenizer= new StringTokenizer(filePatterns, ","); //$NON-NLS-1$
	String[] filePatternArray= new String[tokenizer.countTokens()];
	int i= 0;
	while (tokenizer.hasMoreTokens()) {
		filePatternArray[i++]= tokenizer.nextToken().trim();
	}
	return PatternConstructor.createPattern(filePatternArray, true, false);
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:10,代碼來源:QualifiedNameFinder.java

示例5: createScope

import org.eclipse.jdt.internal.ui.util.PatternConstructor; //導入依賴的package包/類
private static TextSearchScope createScope(IResource scope) {
	ArrayList<String> fileNamePatternStrings= new ArrayList<String>();

	// XXX: Should be configurable via preference, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=81117
	String[] javaExtensions= JavaCore.getJavaLikeExtensions();
	for (int i= 0; i < javaExtensions.length; i++)
		fileNamePatternStrings.add("*." + javaExtensions[i]); //$NON-NLS-1$
	fileNamePatternStrings.add("*.xml"); //$NON-NLS-1$
	fileNamePatternStrings.add("*.ini"); //$NON-NLS-1$

	String[] allPatternStrings= fileNamePatternStrings.toArray(new String[fileNamePatternStrings.size()]);
	Pattern fileNamePattern= PatternConstructor.createPattern(allPatternStrings, false, false);

	return TextSearchScope.newSearchScope(new IResource[] { scope }, fileNamePattern, false);
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:16,代碼來源:PropertyKeyHyperlink.java


注:本文中的org.eclipse.jdt.internal.ui.util.PatternConstructor類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。