本文整理匯總了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}