1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.xnap.search;
21
22 import javax.swing.Action;
23
24 /***
25 * Defines the requirements for classes that provide search support.
26 *
27 * <p>start() is called first. If the user aborts the search stop() is
28 * called.
29 *
30 * <p>After stop() has been called start() might be called again to
31 * requery the search.
32 */
33 public interface Search {
34
35
36
37
38
39 /***
40 * Returns additional actions for this search that can be performed
41 * besides stop and requery.
42 */
43 Action[] getActions();
44
45 /***
46 * Returns the search filter that was used to find the results. This
47 * is also used for double fitering.
48 *
49 * @return null, if no filter was used; the filter, otherwise
50 */
51 SearchFilter getFilter();
52
53 /***
54 * Returns a string that should be shown to the user.
55 */
56 String getName();
57
58 /***
59 * Returns a string that describes the current status.
60 */
61 String getStatus();
62
63 /***
64 * Returns true, if this search is finished and can not be started again.
65 */
66 boolean isDone();
67
68 /***
69 * Returns true, if a tree should be shown next to search results.
70 */
71 boolean showTree();
72
73 /***
74 * Starts this search.
75 *
76 * @param handler the object that handles the results
77 */
78 void start(SearchHandler handler);
79
80 /***
81 * Cancels this search.
82 */
83 void stop();
84
85 }
86