Eclipse - 导出/保存搜索结果

标签 eclipse search

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/

相关文章:

java - ANDROID 使用分享 Intent 分享到 Facebook、Twitter 等

php - 在php中使用超过2个组合参数的内连接sql查询显示记录

search - 如何减少 A* 搜索 8-puzzle 中的长时间执行时间

mysql - 搜索实现困境 : full text vs. 纯 SQL

arrays - 为什么在 HashMap 中查找项目比在数组中查找项目更快?

java - 在Java中寻找数组列表中的特定对象?

java - 使用 Maven 3.5.0 的 Eclipse 中的控制台 View 为空

java - 构造函数未定义,Eclipse 说,但它已定义 (Java)

eclipse - Eclipse构建错误 “A class file was not written. The project may be inconsistent, if so try refreshing this project and building it”

eclipse - eclipse 中的Mylyn是什么? Pydev插件说Mylyn集成