KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > ui > search > PatternQuerySpecification


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.ui.search;
12
13 import org.eclipse.jdt.core.search.IJavaSearchScope;
14
15
16 /**
17  * <p>
18  * Describes a search query by giving a textual pattern to search for.
19  * </p>
20  * <p>
21  * This class is not intended to be instantiated or subclassed by clients.
22  * </p>
23  *
24  * @see org.eclipse.jdt.ui.search.QuerySpecification
25  *
26  * @since 3.0
27  */

28 public class PatternQuerySpecification extends QuerySpecification {
29     private String JavaDoc fPattern;
30     private int fSearchFor;
31     private boolean fCaseSensitive;
32
33     /**
34      * @param pattern
35      * The string that the query should search for.
36      * @param searchFor
37      * What kind of <code>IJavaElement</code> the query should search for.
38      * @param caseSensitive
39      * Whether the query should be case sensitive.
40      * @param limitTo
41      * The kind of occurrence the query should search for.
42      * @param scope
43      * The scope to search in.
44      * @param scopeDescription
45      * A human readable description of the search scope.
46      *
47      * @see org.eclipse.jdt.core.search.SearchPattern#createPattern(java.lang.String, int, int, int)
48      */

49     public PatternQuerySpecification(String JavaDoc pattern, int searchFor, boolean caseSensitive, int limitTo, IJavaSearchScope scope, String JavaDoc scopeDescription) {
50         super(limitTo, scope, scopeDescription);
51         fPattern= pattern;
52         fSearchFor= searchFor;
53         fCaseSensitive= caseSensitive;
54     }
55
56     /**
57      * Whether the query should be case sensitive.
58      * @return Whether the query should be case sensitive.
59      */

60     public boolean isCaseSensitive() {
61         return fCaseSensitive;
62     }
63
64     /**
65      * Returns the search pattern the query should search for.
66      * @return the search pattern
67      * @see org.eclipse.jdt.core.search.SearchPattern#createPattern(java.lang.String, int, int, int)
68      */

69     public String JavaDoc getPattern() {
70         return fPattern;
71     }
72
73     /**
74      * Returns what kind of <code>IJavaElement</code> the query should search for.
75      *
76      * @return The kind of <code>IJavaElement</code> to search for.
77      *
78      * @see org.eclipse.jdt.core.search.IJavaSearchConstants
79      */

80     public int getSearchFor() {
81         return fSearchFor;
82     }
83 }
84
Popular Tags