A tutorial on adding search to an Eclipse RCP program

大城市里の小女人 提交于 2020-01-03 13:56:18

问题


Could some one point me to a tutorial on how to work with the Eclipse search plug-in with custom views in an Eclipse RCP program. I have tried searching google for one, but I have found to have the word "search" in your search phrase you might as well not have it there.

I have tried the phrase "Eclipse RCP search" "Eclipse RCP search tutorial" "Eclipse RCP search plug-in" and none of my results are about the search plug-in (maybe a suggested search phrase if one can not suggest a good tutorial)


回答1:


Implementing your custom search is not that hard. The best is to look into other plugins to see how they implemented the search. To get you started I recommed the Task-Search from Mylyn - very easy to adopt.

Just donwload the sources from Mylyn and look at the bundle

org.eclipse.mylyn.tasks.search

HTH Tom




回答2:


You may start here: http://wiki.eclipse.org/FAQ_How_do_I_write_a_Search_dialog%3F It is not strictly related to RCP development, but I think it applies to that also.




回答3:


As far as I know there isn't a good article about search in Eclipse.

Also see this and this bugs




回答4:


The short answer is that you need 5 classes to implement following interfaces:

  • ISearchQuery
  • ISearchResult
  • SearchResultEvent
  • ISearchPage
  • ISearchResultPage

Furthermore the last 2 implementations need to be registered as extension points:

  • org.eclipse.search.searchPages
  • org.eclipse.search.searchResultViewPages

For a detailed tutorial how to glue this stuff together read this article



来源:https://stackoverflow.com/questions/4628234/a-tutorial-on-adding-search-to-an-eclipse-rcp-program

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!