public abstract class TextSearchScope extends Object
TextSearchScope
defines the scope of a search. The scope consists of all workbench resources that are accepted
by contains(IResourceProxy)
and that either are a root element (getRoots()
) or have a root element
in their parent chain.newSearchScope(IResource[], java.util.regex.Pattern, boolean)
Constructor and Description |
---|
TextSearchScope() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
contains(IResourceProxy proxy)
Returns if a given resource is part of the scope.
|
IFile[] |
evaluateFilesInScope(MultiStatus status)
Evaluates all files in this scope.
|
IResource[] |
getRoots()
Returns the resources that form the root.
|
static TextSearchScope |
newSearchScope(IResource[] rootResources,
Pattern fileNamePattern,
boolean visitDerivedResources)
Creates a scope that consists of all files that match the
fileNamePattern and that
either are one of the roots, or have one of the roots in their parent chain. |
public static TextSearchScope newSearchScope(IResource[] rootResources, Pattern fileNamePattern, boolean visitDerivedResources)
fileNamePattern
and that
either are one of the roots, or have one of the roots in their parent chain.
If visitDerivedResources
is not enabled, all files that are marked derived or
have a derived container in their parent chain are not part of the scope.rootResources
- the resources that are the roots of the scopefileNamePattern
- file name pattern for this scope.visitDerivedResources
- if set also derived folders and files are searched.public IResource[] getRoots()
contains(IResourceProxy)
.public abstract boolean contains(IResourceProxy proxy)
proxy
- the resource proxy to test.true
if a resource is part of the scope. if false
is returned the resource
and all its children are not part of the scope.public IFile[] evaluateFilesInScope(MultiStatus status)
status
- a MultiStatus
to collect the error status that occurred while collecting resources.
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.