Eclipse 的搜索结果 View 以其树状结构非常方便。有没有办法将这些结果导出为可读的文本格式或将它们保存到文件中以备后用?
我试过使用复制和粘贴,但生成的文本格式远不可读。
最佳答案
不,我认为还没有导出结果的可能性。 (更新:Now there's a suitable plugin available)。但是您应该能够以编程方式使用 eclipse 搜索框架并自己导出条目。
我没有测试以下代码片段,但以这种方式实现了一次自定义搜索(使用 RetrieverAction class )。您也应该能够在没有操作的情况下收听搜索结果的变化:
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);
再说一遍:我根本没有测试过,也不知道是否还有更好的方法..
关于Eclipse - 导出/保存搜索结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5339088/