KickJava   Java API By Example, From Geeks To Geeks.

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


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.IJavaElement;
14 import org.eclipse.jdt.core.search.IJavaSearchScope;
15
16 /**
17  * <p>
18  * Describes a search query by giving the {@link IJavaElement} to search
19  * for.
20  * </p>
21  * <p>
22  * This class is not intended to be instantiated or subclassed by clients.
23  * </p>
24  *
25  * @see org.eclipse.jdt.ui.search.QuerySpecification
26  *
27  * @since 3.0
28  */

29 public class ElementQuerySpecification extends QuerySpecification {
30     private IJavaElement fElement;
31
32     /**
33      * A constructor.
34      * @param javaElement The java element the query should search for.
35      * @param limitTo The kind of occurrence the query should search for.
36      * @param scope The scope to search in.
37      * @param scopeDescription A human readable description of the search scope.
38      */

39     public ElementQuerySpecification(IJavaElement javaElement, int limitTo, IJavaSearchScope scope, String JavaDoc scopeDescription) {
40         super(limitTo, scope, scopeDescription);
41         fElement= javaElement;
42     }
43     
44     /**
45      * Returns the element to search for.
46      * @return The element to search for.
47      */

48     public IJavaElement getElement() {
49         return fElement;
50     }
51 }
52
Popular Tags