Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-search-dev] NewSearchUI - results not showing



Hi,
I've been having problems getting search matches displayed
using the NewSearchUI. I've got a workaround but it relies
on an .internal. class so I'm not happy with it!

In a nutshell I'm adding a context menu entry for Java Elements
to allow for reference searches in an xml file (Spring).
Using the debugger I can see the search routine is returning
the correct matches but they don't get displayed unless you do
the search and then display it from the search history.
Performing a new search has a similar problem.

I'm sure I'm missing something but have read and re-read
the docs and can't see what.

Anyway the hack I've come up with is the one immediately after
the TODO line.

---FindReferencesActionDelegate::run()----
      ....
      BeanReferenceSearcher collator = new BeanReferenceSearcher(_fqn);
      NewSearchUI.activateSearchResultView();
      IRunnableContext ctx = new ProgressMonitorDialog(new Shell());
      NewSearchUI.runQueryInForeground(ctx, collator);
      AbstractTextSearchResult matches = collator.getMatches();
      NewSearchUI.activateSearchResultView();
      ISearchResultViewPart part = NewSearchUI.getSearchResultView();
      BeanSearchResultPage myPage = new BeanSearchResultPage();
      myPage.setViewPart(part);

      //TODO: work out how to do this next line without relying on internal
      ((SearchView) part).showSearchResult(matches);  // <- hack!

      ISearchResultPage page = part.getActivePage();
      NewSearchUI.activateSearchResultView();
      ...
-----------------

I've registered the BeanSearchResultPage to the ext-point
org.eclipse.search.searchResultViewPages.  Is there any other
step I need to take before invoking the NewUISearch?

I'm using Eclipse 3.0 on Sun JDK 1.4.2 on Win2000.

Any ideas/pointers would be gratefully appreciated.

Regards,
Dave Watkins



Back to the top