Eclipse - Export/Save Search Results

旧街凉风 提交于 2019-12-28 14:02:10

问题


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 later use?

I've tried using copy & paste but the resulting text format is far from readable.


回答1:


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..




回答2:


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




回答3:


I'm using Eclipse Search CSV Export.



来源:https://stackoverflow.com/questions/5339088/eclipse-export-save-search-results

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