KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > xam > ui > search > SearchProvider


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.xml.xam.ui.search;
21
22 import java.util.List JavaDoc;
23
24 /**
25  * Provides the capability to search a XAM model and display the results
26  * in a manner appropriate for the current view of the model.
27  *
28  * @author Nathan Fiedler
29  */

30 public interface SearchProvider {
31
32     /**
33      * Returns the display string for describing this search provider.
34      *
35      * @return display name.
36      */

37     String JavaDoc getDisplayName();
38
39     /**
40      * Returns a description of the expected input for this provider.
41      * This is used to instruct the user on what should be entered into
42      * the search field.
43      *
44      * @return description of expected input.
45      */

46     String JavaDoc getInputDescription();
47
48     /**
49      * Returns a brief description of this provider, useful for tooltips.
50      *
51      * @return short description.
52      */

53     String JavaDoc getShortDescription();
54
55     /**
56      * Performs the search using the given query string. The query string
57      * will match any element that contains the given string, whether in
58      * whole or in part (i.e. a "sub-string" search), and will be compared
59      * in a case-insensitive fashion.
60      *
61      * @param query encapsulates the search parameters.
62      * @return search results, or empty if none found.
63      * @throws SearchException
64      * if the search resulted in an unexpected error.
65      */

66     List JavaDoc<Object JavaDoc> search(Query query) throws SearchException;
67 }
68
Popular Tags