1 11 12 package org.eclipse.search.core.text; 13 14 import java.util.regex.Pattern ; 15 16 import org.eclipse.core.runtime.MultiStatus; 17 18 import org.eclipse.core.resources.IFile; 19 import org.eclipse.core.resources.IResource; 20 import org.eclipse.core.resources.IResourceProxy; 21 import org.eclipse.core.resources.ResourcesPlugin; 22 23 import org.eclipse.search.internal.core.text.FileNamePatternSearchScope; 24 import org.eclipse.search.internal.core.text.FilesOfScopeCalculator; 25 26 34 public abstract class TextSearchScope { 35 36 37 48 public static TextSearchScope newSearchScope(IResource[] rootResources, Pattern fileNamePattern, boolean visitDerivedResources) { 49 FileNamePatternSearchScope scope= FileNamePatternSearchScope.newSearchScope(new String (), rootResources, visitDerivedResources); 50 scope.setFileNamePattern(fileNamePattern); 51 return scope; 52 } 53 54 55 61 public IResource[] getRoots() { 62 return new IResource[] { ResourcesPlugin.getWorkspace().getRoot() }; 63 } 64 65 73 public abstract boolean contains(IResourceProxy proxy); 74 75 76 82 public IFile[] evaluateFilesInScope(MultiStatus status) { 83 return new FilesOfScopeCalculator(this, status).process(); 84 } 85 86 87 } 88 | Popular Tags |