Eclipse 插件 - 与文件扩展名和透视图关联的编辑器

我正在开发两个eclipse插件,我有下一个问题:

I'm developing tow eclipse plugin, I have the next problem:

我有两个管理相同文件的视角.我想在文件扩展名 - 编辑器 - 透视图之间建立关联.

I have two perspective that manages the same files. I would like to make an association between file extension - editor - perspective.

我的意思是,如果我在透视 1 中打开文件扩展名 .XXX,它使用编辑器 A,但如果我在透视 2 中打开相同的文件扩展名 .XXX,它使用编辑器 B.

I mean if I open the file extension .XXX in perspective 1 it uses the editor A, but if I open the same file extension .XXX in perspective 2, it uses the editor B.

有可能吗?从现在开始,我使用了启动器,但现在我需要更多的差异化.

is it possible? Since now, I used the launcher but now I need more differentiation.

谢谢.

推荐答案

(对不起,这是不要那样做!"未回答的问题之一.:))

(Sorry, this is one of those "don't do that!" non-answers. :))

正如评论中提到的,我建议不要根据当前的观点打开不同的编辑器.我认为这违背了用户的期望,并且会产生一些不直观的后果,例如当我创建自己的观点时.

As mentioned in the comments, I'd recommend against opening a different editor depending on the current perspective. I think that goes against the expectations of the user, and has some unintuitive consequences, e.g. when I create my own perspectives.

例如,我建议使用 Eclipse 的 XML/Plug-in 清单编辑器.底部的选项卡允许用户在不同的视图之间进行选择,而不受任何视角选择或配置的影响.

I'd recommend going the path of Eclipse' XML/Plug-in manifest editors, for example. Tabs at the bottom allow the user to choose between the different views, independent of any perspective choice or configuration.

相关文章