1 11 12 package org.eclipse.search.core.text; 13 14 import java.util.regex.Pattern ; 15 16 import org.eclipse.core.runtime.IProgressMonitor; 17 import org.eclipse.core.runtime.IStatus; 18 19 import org.eclipse.core.resources.IFile; 20 21 import org.eclipse.search.internal.core.text.TextSearchVisitor; 22 import org.eclipse.search.internal.ui.SearchPlugin; 23 24 34 public abstract class TextSearchEngine { 35 36 41 public static TextSearchEngine create() { 42 return SearchPlugin.getDefault().getTextSearchEngineRegistry().getPreferred(); 43 } 44 45 51 public static TextSearchEngine createDefault() { 52 return new TextSearchEngine() { 53 public IStatus search(TextSearchScope scope, TextSearchRequestor requestor, Pattern searchPattern, IProgressMonitor monitor) { 54 return new TextSearchVisitor(requestor, searchPattern).search(scope, monitor); 55 } 56 57 public IStatus search(IFile[] scope, TextSearchRequestor requestor, Pattern searchPattern, IProgressMonitor monitor) { 58 return new TextSearchVisitor(requestor, searchPattern).search(scope, monitor); 59 } 60 }; 61 } 62 63 73 public abstract IStatus search(TextSearchScope scope, TextSearchRequestor requestor, Pattern searchPattern, IProgressMonitor monitor); 74 75 85 public abstract IStatus search(IFile[] scope, TextSearchRequestor requestor, Pattern searchPattern, IProgressMonitor monitor); 86 87 } 88 | Popular Tags |