Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-search-dev] Example of contributed SearchPage code



> I plan to contribute my own SearchPage.  (BTW: Since there is no
'Example'
> in the Plugin-Developers Guide of doing this, if someone can point me to
> the source code of a well-documented Example, I would be most grateful).
Checkout
* Platform Plug-in Developer Guide
  - searchPages extension point documentation
  - searchResultSorters extension point documentation
* File/Text Search:
  - plugin.xml for the Search plug-in (org.eclipse.search)
  - package org.eclipse.search.internal.ui.text in the Search plug-in
* Java Search:
  - plugin.xml for the JDT UI plug-in (org.eclipse.jdt.ui)
  - package org.eclipse.jdt.internal.ui.search in the JDT UI plug-in

> In particular, since in my environment there may be hundreds of resources
> to be searched, and the examination of those resources may not be very
> rapid, I wonder if it would be my responsibility to show some kind of
> visual progress indicator,
Yes, you have to take care of this since only your search engine can
provide feedback on the progress for the ongoing search. Basically you have
to write a search operation (derived from WorkspaceModifyOperation) which
implements execute(IProgressMonitor). During the search operation you can
report progress to the IProgressMonitor. You can see how this can be done
by looking at the code in TextSearchPage.performAction()

> or if the user will see each resource I add to
> the results in the search list as soon as I post it.
This is discouraged because this would mean to send n resource deltas
instead of just a single one at the end and since the search is not
performed in the background there's no big benefit for the user.

HTH
Dani



Back to the top