Package org.eclipse.search.ui.text
Class FileTextSearchScope
java.lang.Object
org.eclipse.search.core.text.TextSearchScope
org.eclipse.search.ui.text.FileTextSearchScope
A text search scope used by the file search dialog. Additionally to roots it allows to define file name
patterns and exclude all derived resources.
Clients should not instantiate or subclass this class.
- Since:
- 3.2
- Restriction:
- This class is not intended to be instantiated by clients.
-
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(IResourceProxy proxy) Returns if a given resource is part of the scope.Returns the content types configured for this scope ornullto match all content types.Returns the description of the scopeString[]Returns the file name pattern configured for this scope ornullto match all file names.Returns a description describing the file name patterns and content types.getRoots()Returns the resources that form the root.Returns the working-sets that were used to configure this scope ornullif the scope was not created off working sets.booleanReturns whether derived resources are included in this search scope.static FileTextSearchScopenewSearchScope(IResource[] roots, String[] fileNamePatterns, boolean includeDerived) Returns a scope for the given root resources.static FileTextSearchScopenewSearchScope(IWorkingSet[] workingSets, String[] fileNamePatterns, boolean includeDerived) Returns a scope for the given working sets.static FileTextSearchScopenewWorkspaceScope(String[] fileNamePatterns, boolean includeDerived) Returns a scope for the workspace.Methods inherited from class org.eclipse.search.core.text.TextSearchScope
evaluateFilesInScope, newSearchScope
-
Method Details
-
newWorkspaceScope
public static FileTextSearchScope newWorkspaceScope(String[] fileNamePatterns, boolean includeDerived) Returns a scope for the workspace. The created scope contains all resources in the workspace that match the given file name patterns. Depending onincludeDerived, derived resources or resources inside a derived container are part of the scope or not.- Parameters:
fileNamePatterns- file name pattern that all files have to matchnullto include all file names.includeDerived- defines if derived files and files inside derived containers are included in the scope.- Returns:
- a scope containing all files in the workspace that match the given file name patterns.
-
newSearchScope
public static FileTextSearchScope newSearchScope(IResource[] roots, String[] fileNamePatterns, boolean includeDerived) Returns a scope for the given root resources. The created scope contains all root resources and their children that match the given file name patterns. Depending onincludeDerived, derived resources or resources inside a derived container are part of the scope or not.- Parameters:
roots- the roots resources defining the scope.fileNamePatterns- file name pattern that all files have to matchnullto include all file names.includeDerived- defines if derived files and files inside derived containers are included in the scope.- Returns:
- a scope containing the resources and their children if they match the given file name patterns.
-
newSearchScope
public static FileTextSearchScope newSearchScope(IWorkingSet[] workingSets, String[] fileNamePatterns, boolean includeDerived) Returns a scope for the given working sets. The created scope contains all resources in the working sets that match the given file name patterns. Depending onincludeDerived, derived resources or resources inside a derived container are part of the scope or not.- Parameters:
workingSets- the working sets defining the scope.fileNamePatterns- file name pattern that all files have to matchnullto include all file names.includeDerived- defines if derived files and files inside derived containers are included in the scope.- Returns:
- a scope containing the resources in the working set if they match the given file name patterns.
-
getDescription
Returns the description of the scope- Returns:
- the description of the scope
-
getFileNamePatterns
Returns the file name pattern configured for this scope ornullto match all file names.- Returns:
- the file name pattern starings
-
getWorkingSets
Returns the working-sets that were used to configure this scope ornullif the scope was not created off working sets.- Returns:
- the working-sets the scope is based on.
-
getContentTypes
Returns the content types configured for this scope ornullto match all content types.- Returns:
- the file name pattern starings
-
getFilterDescription
Returns a description describing the file name patterns and content types.- Returns:
- the description of the scope
-
includeDerived
public boolean includeDerived()Returns whether derived resources are included in this search scope.- Returns:
- whether derived resources are included in this search scope.
-
getRoots
Description copied from class:TextSearchScopeReturns the resources that form the root. Roots can not contain each other. Root elements are only part of the scope if they are also accepted byTextSearchScope.contains(IResourceProxy).- Overrides:
getRootsin classTextSearchScope- Returns:
- returns the set of root resources. The default behavior is to return the workspace root.
-
contains
Description copied from class:TextSearchScopeReturns if a given resource is part of the scope. If a container is not part of the scope, also all its members are not part of the scope.- Specified by:
containsin classTextSearchScope- Parameters:
proxy- the resource proxy to test.- Returns:
- returns
trueif a resource is part of the scope. iffalseis returned the resource and all its children are not part of the scope.
-