KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > search > ui > ISearchResultView


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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.search.ui;
12
13 import org.eclipse.jface.action.IAction;
14 import org.eclipse.jface.operation.IRunnableWithProgress;
15 import org.eclipse.jface.resource.ImageDescriptor;
16 import org.eclipse.jface.viewers.ILabelProvider;
17 import org.eclipse.jface.viewers.ISelection;
18
19 import org.eclipse.core.resources.IMarker;
20 import org.eclipse.core.resources.IResource;
21 import org.eclipse.ui.IViewPart;
22
23 /**
24  * Provides client access to the search result view.
25  * Each element in the view is a <code>ISearchResultViewEntry</code>,
26  * which groups markers based on the <code>groupByKey</code> provided
27  * by the client each time when adding a match. If every match should
28  * show up in the search result view then the match itself can be used
29  * as key.
30  * <p>
31  * The search result view has id <code>"org.eclipse.search.SearchResultView"</code>.
32  * </p>
33  * <p>
34  * This interface is not intended to be implemented by clients.
35  * </p>
36  * @deprecated Part of the old ('classic') search result view. Since 3.0 clients can create their own search result view pages.
37  * To access the parent view, {@link org.eclipse.search.ui.ISearchResultViewPart} is used instead.
38  */

39 public interface ISearchResultView extends IViewPart {
40
41     /**
42      * Informs the view that a search has started.
43      * Provides all necessary information to create an entry in the search result
44      * view.
45      * If every match should show up in the search result view then the match
46      * itself can be used as key.
47      *
48      * @param groupFactory the action group factory
49      * or <code>null</code> if no factory is provided.
50      * @param singularLabel the label to be used for this search occurrence
51      * if there is one match
52      * or <code>null</code> if the pluralLabelPattern should be used
53      * @param pluralLabelPattern the label pattern to be used for this search occurrence
54      * if there are more than one matches or none.
55      * This string may contain {0} which will be replace by the match count
56      * @param imageDescriptor the image descriptor to be used for this search occurrence,
57      * or <code>null</code> if this search should not have an image
58      * @param pageId the id of the search page which started the search
59      * @param labelProvider the label provider used by this search result view
60      * or <code>null</code> if the default provider should be used.
61      * The default label provider shows the resource name and the corresponding image.
62      * @param gotoAction the action used by the view to go to a marker
63      * @param groupByKeyComputer the computer used by the view to compute the key for a marker
64      * @param operation the runnable used by the view to repeat the search
65      *
66      * @see IActionGroupFactory
67      * @since 2.0
68      */

69     public void searchStarted(
70                 IActionGroupFactory groupFactory,
71                 String JavaDoc singularLabel,
72                 String JavaDoc pluralLabelPattern,
73                 ImageDescriptor imageDescriptor,
74                 String JavaDoc pageId,
75                 ILabelProvider labelProvider,
76                 IAction gotoAction,
77                 IGroupByKeyComputer groupByKeyComputer,
78                 IRunnableWithProgress operation);
79
80     /**
81      * Returns the current selection of the search result view
82      *
83      * @return the current selection of the search result view
84      * @see org.eclipse.jface.viewers.ISelectionProvider#getSelection
85      */

86     public ISelection getSelection();
87
88     /**
89      * Informs the view that a search has started.
90      * Provides all necessary information to create an entry in the search result
91      * view.
92      * If every match should show up in the search result view then the match
93      * itself can be used as key.
94      *
95      * @param pageId the id of the search page which started the search
96      * @param label the label to be used for this search occurrence
97      * @param imageDescriptor the image descriptor to be used for this search occurrence,
98      * or <code>null</code> if this search should not have an image
99      * @param contributor the context menu contributor
100      * or <code>null</code> if no context menu is contributed
101      * @param labelProvider the label provider used by this search result view
102      * or <code>null</code> if the default provider should be used.
103      * The default label provider shows the resource name and the corresponding image.
104      * @param gotoAction the action used by the view to go to a marker
105      * @param groupByKeyComputer the computer used by the view to compute the key for a marker
106      * @param operation the runnable used by the view to repeat the search
107      * @deprecated As of build > 20011107, replaced by the new version with additional parameter
108      */

109     public void searchStarted(
110                 String JavaDoc pageId,
111                 String JavaDoc label,
112                 ImageDescriptor imageDescriptor,
113                 IContextMenuContributor contributor,
114                 ILabelProvider labelProvider,
115                 IAction gotoAction,
116                 IGroupByKeyComputer groupByKeyComputer,
117                 IRunnableWithProgress operation);
118
119     /**
120      * Informs the view that a search has started.
121      * Provides all necessary information to create an entry in the search result
122      * view.
123      * If every match should show up in the search result view then the match
124      * itself can be used as key.
125      *
126      * @param pageId the id of the search page which started the search
127      * @param singularLabel the label to be used for this search occurrence
128      * if there is one match
129      * or <code>null</code> if the pluralLabelPattern should be used
130      * @param pluralLabelPattern the label pattern to be used for this search occurrence
131      * if there are more than one matches or none.
132      * This string may contain {0} which will be replace by the match count
133      * @param imageDescriptor the image descriptor to be used for this search occurrence,
134      * or <code>null</code> if this search should not have an image
135      * @param contributor the context menu contributor
136      * or <code>null</code> if no context menu is contributed
137      * @param labelProvider the label provider used by this search result view
138      * or <code>null</code> if the default provider should be used.
139      * The default label provider shows the resource name and the corresponding image.
140      * @param gotoAction the action used by the view to go to a marker
141      * @param groupByKeyComputer the computer used by the view to compute the key for a marker
142      * @param operation the runnable used by the view to repeat the search
143      * @since 2.0
144      * @deprecated As of build > 20020514, replaced by the new version which provides an action group factory
145      */

146     public void searchStarted(
147                 String JavaDoc pageId,
148                 String JavaDoc singularLabel,
149                 String JavaDoc pluralLabelPattern,
150                 ImageDescriptor imageDescriptor,
151                 IContextMenuContributor contributor,
152                 ILabelProvider labelProvider,
153                 IAction gotoAction,
154                 IGroupByKeyComputer groupByKeyComputer,
155                 IRunnableWithProgress operation);
156
157     /**
158      * Informs the view that the search has finished.
159      * This method must also be called in case of the search
160      * fails or has been canceled.
161      */

162     public void searchFinished();
163
164     /**
165      * Informs the view that a match has been found.
166      * Provides all necessary information to create a search result entry in this
167      * view.
168      * <p>
169      * Note: It is the clients responsibility to create the marker for this match.
170      * </p>
171      *
172      * @param description the text description of the match
173      * @param groupByKey the <code>Object</code> by which this match is grouped
174      * @param marker the marker for this match
175      * @param resource the marker's resource passed for optimization
176      */

177     public void addMatch(String JavaDoc description, Object JavaDoc groupByKey, IResource resource, IMarker marker);
178
179     /**
180      * Returns the label provider of a search result view.
181      *
182      * @return the label provider of a search result view or <code>null</code>
183      * @since 2.0
184      */

185     public ILabelProvider getLabelProvider();
186 }
187
Popular Tags