| 
| Search issue [message #45813] | Fri, 23 May 2003 10:28  |  | 
| Eclipse User  |  |  |  |  | Hello everyone. 
 I'm having some issues when extending eclipse's search functionality:
 
 As far as i can understand, this is the way to do it:
 
 Implement a search page by subclassing a DialogPage that implements
 ISearchPage.
 
 in the ISearchPage.performAction(), do the following:
 public boolean performAction(){
 SearchUI.activateSearchResultView();
 ISearchResultView view=SearchUI.getSearchResultView();
 view.searchStarted(...);
 /* do the actual search by filling up with calls to:*/
 view.addMatch(...);
 view.searchFinished();
 return true;
 }
 
 However, when running my code, the result does not get displayed in the
 Search Result View, unless I close and open the view (thus forcing a refresh
 of some kind).
 
 I have tried miscellaneous ways embedding the actual search in a
 RunnableWithProgress that is run in the container.getRunnableContext, but
 the results remain the same.
 
 Weird? I appreciate all help.
 
 Thanks,
 Emil Einarsson
 |  |  |  | 
| 
| Re: Search issue [message #46724 is a reply to message #45813] | Fri, 23 May 2003 14:57   |  | 
| Eclipse User  |  |  |  |  | Yeah, it's harder than that (I was trying to do something simpler than what it seems like you are doing); see just-entered bug
 https://bugs.eclipse.org/bugs/show_bug.cgi?id=38062 for a partial description of
 what I had to do; then take a look at how the TextSearchEngine/Operation/Visitor
 stuff works (which has the operations correctly wrapped in the WorkspaceRunnable
 and all). That may well tell you more about what you need to do (I don't know
 that you will have to copy all dozen classes the way I did).
 
 HTH,
 Paul K
 
 Emil Einarsson wrote:
 
 > Hello everyone.
 >
 > I'm having some issues when extending eclipse's search functionality:
 >
 > As far as i can understand, this is the way to do it:
 >
 > Implement a search page by subclassing a DialogPage that implements
 > ISearchPage.
 >
 > in the ISearchPage.performAction(), do the following:
 > public boolean performAction(){
 >    SearchUI.activateSearchResultView();
 >    ISearchResultView view=SearchUI.getSearchResultView();
 >    view.searchStarted(...);
 >    /* do the actual search by filling up with calls to:*/
 >    view.addMatch(...);
 >    view.searchFinished();
 >    return true;
 > }
 >
 > However, when running my code, the result does not get displayed in the
 > Search Result View, unless I close and open the view (thus forcing a refresh
 > of some kind).
 >
 > I have tried miscellaneous ways embedding the actual search in a
 > RunnableWithProgress that is run in the container.getRunnableContext, but
 > the results remain the same.
 >
 > Weird? I appreciate all help.
 >
 > Thanks,
 > Emil Einarsson
 |  |  |  | 
|  | 
| 
| Re: Search issue [message #48291 is a reply to message #47827] | Mon, 26 May 2003 10:09  |  | 
| Eclipse User  |  |  |  |  | Problem solved: 
 The marker type used in addMatch MUST be a subtype of
 org.eclipse.search.searchmarker for results to be discovered by the search
 result viewer.
 
 I had not registered my search marker properly, but the marker type was
 still accepted by the platform, no indication of what was wrong. Tricky
 thing, this...
 
 Thanks for the help
 
 Regards,
 Emil
 
 "Daniel Megert" <daniel.megert@gmx.net> skrev i meddelandet
 news:basl6o$miu$1@rogue.oti.com...
 > Emil Einarsson wrote:
 >
 > >Hello everyone.
 > >
 > >I'm having some issues when extending eclipse's search functionality:
 > >
 > >As far as i can understand, this is the way to do it:
 > >
 > >Implement a search page by subclassing a DialogPage that implements
 > >ISearchPage.
 > >
 > >in the ISearchPage.performAction(), do the following:
 > >public boolean performAction(){
 > >   SearchUI.activateSearchResultView();
 > >   ISearchResultView view=SearchUI.getSearchResultView();
 > >   view.searchStarted(...);
 > >   /* do the actual search by filling up with calls to:*/
 > >   view.addMatch(...);
 > >   view.searchFinished();
 > >   return true;
 > >}
 > >
 > >However, when running my code, the result does not get displayed in the
 > >Search Result View, unless I close and open the view (thus forcing a
 refresh
 > >of some kind).
 > >
 > >I have tried miscellaneous ways embedding the actual search in a
 > >RunnableWithProgress that is run in the container.getRunnableContext, but
 > >the results remain the same.
 > >
 > Try running it in a WorkspaceModifyOperation. This is the suggested way
 > because you will end up with only one resource delta instead of 1 per
 > marker that you create.
 > You should also write a bug report: assuming you did everything right,
 > there should be no need to close and reopen the Search view to see the
 > results. Also check your .log for possible exceptions.
 >
 > HTH
 > Dani
 >
 |  |  |  | 
Powered by 
FUDForum. Page generated in 0.05650 seconds