Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » [Howto] create a new SearchPage etc. in 3.0 (eight or ten questions not answered anywhere)
[Howto] create a new SearchPage etc. in 3.0 (eight or ten questions not answered anywhere) [message #279848] Mon, 24 January 2005 17:27
Eclipse UserFriend
None of the ten questions herein are answered at http://www.eclipsefaq.org/chris/faq/ (see FAQ’s
278, 279, and 280 – note that 280 seems to refer to the 2.1-search code) nor in the built-in
documentation for Eclipse 3.0 (under Platform Plugin Developer Guide); the answers to Q1-Q4 have
been culled from the newsgroup, but Q1 and Q4 at least need further clarification; Q5 was asked on
the newsgroup but was never answered.

========================

Q1. I can get my new search page to come up. But, I am adding the matches to the search but the list
of the matches does not show up. [is this for 2.1 only?]

A. Make your search operation to be a WorkspaceModifyOperation. (daniel.megert@acm.org) 2003 Sept

========================

Q2. Is there an example of how to support navigating from a search results view
to another view? For example, when I search for a Java class, I see the following Context
menus: Show In > Package Explorer and Show In > Navigator. If I choose either of
these, the appropriate view gets focus and the class is highlighted. I want to do a similar thing,
but I only want my Show In item to appear in a certain search result page. Is that possible?

A. I believe your search result page must be an IAdaptable, and be able to adapt to
IShowInTargetList. Your implementation of IShowInTargetList then provides the set of applicable
views. The following snippets are from the FileSearchPage (in the org.eclipse.search plugin):

private static final String[] SHOW_IN_TARGETS= new String[] {
IPageLayout.ID_RES_NAV };

private static final IShowInTargetList SHOW_IN_TARGET_LIST=
new IShowInTargetList() {
public String[] getShowInTargetIds() {
return SHOW_IN_TARGETS;
}
};
public Object getAdapter(Class adapter) {
if (IShowInTargetList.class.equals(adapter)) {
return SHOW_IN_TARGET_LIST;
}
return null;
}
(john@eclipsefaq.org) 2004 July

========================

Q3. I need to hide programmatically some pages such as “Help Search” from Search dialog. I was
looking for SearchUI but I couldn’t find the way to do this.

A. This is a Search dialog feature (combined with extension point) to which clients have no access.
(daniel.megert@acm.org) 2004 Aug

========================

Q4. How can I configure my plug-in to show my Search page like the first page
that it is shown when the Search dialog is opened?

A. See NewSearchUI.openSearchDialog(IWorkbenchWindow, String) and ISearchPageScoreComputer. The idea
is that when hitting Search Eclipse tries to find the best fitting page via
ISearchPageScoreComputer. (daniel.megert@acm.org) 2004 Aug

Problem: It seems that the plugin.xml is supposed to specify this through the use of the tags
“tabPosition” and “extensions” – how do they relate to the answer above?

========================

Q5. The ISearchResultView.addmatch() method takes in a IResource. Can I add results which are not of
the type IResource? (phrased for 2.1, I think, but applies to 3.0, if we just say “Can I display
results which are not of the type IResource?”)

A. ……………

========================

Q6. ISearchPage is implemented for the extension-point org.eclipse.search.searchPages; clients
usually subclass DialogPage; clients implement an ISearchPage by, among other things, implementing
performAction() about as follows:
{
/* org.eclipse.search.ui. */ISearchQuery searchJob = …
NewSearchUI.activateSearchResultView();
NewSearchUI.runQuery(searchJob);
return true;
}
Correct?

A. ……………

========================

Q7. The problem of course is to define correctly the org.eclipse.search.ui.ISearchQuery which must
(among other things) return an ISearchResult. What else should one know about ISearchQuery?

A. ……………

========================

Q8. ISearchResult has an abstract implementation class AbstractTextSearchResult which is the one to
subclass. What else should one know about ISearchResult?

A. ……………

========================

Q9. ISearchResultPage is implemented for the extension-point
org.eclipse.search.searchResultViewPages; clients usually subclass AbstractTextSearhViewPage – does
the use of the extension-point somehow automagically result in the given implementation of
ISearchResultPage being used, or is there more to do?

A. ……………

========================

Q10. What about the extension-point org.eclipse.search.searchResultSorters? Is that for 2.1 or for
3.0? If it is for 2.1, how does one create those “grouping” buttons in the 3.0-search?

A. ……………
Previous Topic:Default launch config for JUnit Test
Next Topic:Compiler warning about finally
Goto Forum:
  


Current Time: Tue Jul 22 16:25:00 EDT 2025

Powered by FUDForum. Page generated in 0.02493 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top