枚举我所有的Eclipse编辑器? [英] Enumerating all my Eclipse editors?

查看:87
本文介绍了枚举我所有的Eclipse编辑器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我构建了一个简单的Eclipse插件,用户可以在其中使用 TableViewer 数据库资源在任何这些资源上打开编辑器。

I have built a simple Eclipse plugin where a user may use a TableViewer of database resources to open an editor on any of those resources.

因此,用户可能会运行零个向上的编辑器实例。

Users may therefore have zero upwards instances of the editor running.

是否有可用的API来获取这些编辑器实例的列表?

Is there an API available to get a list of those editor instances?

推荐答案

您可以通过以下方式获得对所有打开的编辑器的引用:

You can get references to all open editors with:

PlatformUI.getWorkbench().getActiveWorkbenchWindow()
    .getActivePage().getEditorReferences();

然后选中这些内容以选择引用您的编辑器类型实例的对象。

And then check these to select the ones that reference instances of your editor type.

这篇关于枚举我所有的Eclipse编辑器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆