Class FileTextSearchScope

java.lang.Object
org.eclipse.search.core.text.TextSearchScope
org.eclipse.search.ui.text.FileTextSearchScope

public final class FileTextSearchScope extends TextSearchScope
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 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 on includeDerived, 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 match null to 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 on includeDerived, 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 match null to 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 on includeDerived, 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 match null to 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

      public String getDescription()
      Returns the description of the scope
      Returns:
      the description of the scope
    • getFileNamePatterns

      public String[] getFileNamePatterns()
      Returns the file name pattern configured for this scope or null to match all file names.
      Returns:
      the file name pattern starings
    • getWorkingSets

      public IWorkingSet[] getWorkingSets()
      Returns the working-sets that were used to configure this scope or null if the scope was not created off working sets.
      Returns:
      the working-sets the scope is based on.
    • getContentTypes

      public IContentType[] getContentTypes()
      Returns the content types configured for this scope or null to match all content types.
      Returns:
      the file name pattern starings
    • getFilterDescription

      public String 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

      public IResource[] getRoots()
      Description copied from class: TextSearchScope
      Returns 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 by TextSearchScope.contains(IResourceProxy).
      Overrides:
      getRoots in class TextSearchScope
      Returns:
      returns the set of root resources. The default behavior is to return the workspace root.
    • contains

      public boolean contains(IResourceProxy proxy)
      Description copied from class: TextSearchScope
      Returns 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:
      contains in class TextSearchScope
      Parameters:
      proxy - the resource proxy to test.
      Returns:
      returns 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.