Skip to main content

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



Hi Markus,
Thanks for your suggestions. Unfortunately, it's still not
working :(

I tried setting the code back to your example and I also
ensured the search was the same object (based on the code from
the NLSSearchQuery).

I thought it may have something to do with
'ISearchQuery::canRunInBackground()' so I forced that
method to return false.  Unfortunately none of this worked and
I still have the same problem - namely the results don't show
until I access them from the search history.

Any other ideas?  I have a feeling it's something missing from the
plugin.xml, other than registering the result page is there anything
else I have to do in terms of initialisation.  I added a subsequent
call to 'NewSearchUI.getSearchResultView().getActivePage()' and
inspected the result it was showing my 'BeanSearchResultPage' and
I could see my matches stored in it - weird!

Anyway thanks again for your help , I think I've probably forgotten
something really obvious.  Does anyone know of any simple 'all-in-one'
examples out there I can take a look at?

Cheers,
Dave Watkins



platform-search-dev-admin@xxxxxxxxxxx wrote on 24/08/2004 18:15:10:

>
> You should not have to call setViewPart(), showSearchResult(), etc.
manually.
>
> Have you tried simplifying your code to e.g. the following?
>
>       BeanReferenceSearcher collator = new BeanReferenceSearcher(_fqn);
>      NewSearchUI.activateSearchResultView();
>      IRunnableContext ctx = new ProgressMonitorDialog(new Shell());
>      NewSearchUI.runQueryInForeground(ctx, collator);
>
> Another possible problem source I could think of is the method
> getSearchResult() of your ISearchQuery (BeanReferenceSearcher). This
> method must return the same object if called multiple times (see e.
> g. NLSSearchQuery from org.eclipse.jdt.ui). You have to create the
> object on the first request, and then add matches to it as your
> search engine encounters them (e.g. via
AbstractTextSearchResult#addMatch()).
>
> HTH,
> Markus
>

>
> David Watkins <David_Watkins@xxxxxxxx>
> Sent by: platform-search-dev-admin@xxxxxxxxxxx
> 08/24/2004 05:39 PM
>
> Please respond to
> platform-search-dev@xxxxxxxxxxx
>
> To
>
> platform-search-dev@xxxxxxxxxxx
>
> cc
>
> Subject
>
> [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
>
> _______________________________________________
> platform-search-dev mailing list
> platform-search-dev@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/platform-search-dev



Back to the top