Eclipse - 导出/保存搜索结果 [英] Eclipse - Export/Save Search Results
问题描述
我已经尝试使用copy&粘贴,但生成的文本格式远远不可读。
不,我不认为有可能导出结果然而。 (更新:现在有一个合适的插件可用)。但是您应该能够以编程方式使用eclipse搜索框架自己导出条目。
我没有测试以下剪切但是实现了一次自定义搜索使用 RetrieverAction class )。您应该能够听取搜索结果更改,而不采取任何行动:
TextSearchQueryProvider provider = TextSearchQueryProvider.getPreferred();
//你的输入(你必须实现那个我想...)
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
}
} );
//运行查询
NewSearchUI.runQueryInBackground(query);
再次:我根本没有测试,不知道是否有更好的方法好吧..
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.
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..
这篇关于Eclipse - 导出/保存搜索结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!