Eclipse - Export/Save Search Results

后端 未结 3 1980
小蘑菇
小蘑菇 2020-12-10 01:13

Eclipse\'s Search results view is quite handy with its tree-like structure. Is there any way to export these results to a readable text format or save them to a file for lat

相关标签:
3条回答
  • 2020-12-10 01:19

    No I don't think there is a possibility to export the results yet. (Update: Now there's a suitable plugin available). But you should be able to use the eclipse search framework programmatically an export the entries by yourself.

    I did not test the following snipped but implemeted a custom search that way once (using the RetrieverAction class). You should be able to listen to search result changes without the action as well:

    TextSearchQueryProvider provider= TextSearchQueryProvider.getPreferred();
    
    // your input (you'll have to implement that one I think...)
    TextSearchInput input = new TextSearchQueryProvider.TextSearchInput();
    
    ISearchQuery query= provider.createQuery(input);
    ISearchResult result = query.getSearchResult();
    result.addListener(new ISearchResultListener() {
    
        public void searchResultChanged(SearchResultEvent e) {
            // -> export result
        }
    });
    
    // run the query
    NewSearchUI.runQueryInBackground(query);
    

    Again: I did not test that at all and don't know if there is a better approach as well..

    0 讨论(0)
  • 2020-12-10 01:30

    You can change the mode from tree to list by click 'upper-right corner triangle' ->'show in list', then just copy all the files in the list , it will be a perfect list of search result

    0 讨论(0)
  • 2020-12-10 01:39

    I'm using Eclipse Search CSV Export.

    0 讨论(0)
提交回复
热议问题