如何控制在Eclipse Editor中选择特定文件类型的视图 [英] How to control a View on selecting particular File Type in Eclipse Editor

查看:209
本文介绍了如何控制在Eclipse Editor中选择特定文件类型的视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想控制一个视图,就像我选择一个.js类型的文件一样,特定视图对于所有其他类型应该是不可见的。
我不想使用透视图只是一个选择,它将是一个开销。
请通过Eclipse插件开发建议我任何方式实现相同的方式。

I want to control a view , like if I select a .js type of file , a particular view should be visible else for all other type it shouldn't. I dont want to use perspective as for just a single selection, it will be an overhead. Please suggest me any way to achieve the same through Eclipse plug-in Development.

推荐答案

你不要提一个透视图(在这种情况下,当视图被显示时它默认为右下角),或者使用 org.eclipse.ui.perspectiveExtensions 扩展名指向一个具体位置。默认情况下,您可以使其可见或不可见。

When you contribute the view, you either don't mention a perspective (in which case when the view is shown it defaults to the bottom right) or you use the org.eclipse.ui.perspectiveExtensions extension point to contribute it to a specific location. You can make it visible or invisible by default.

您可以使用 org.eclipse.ui.IWorkbenchCommandConstants在运行时使视图可见/不可见。 VIEWS_SHOW_VIEW 命令和视图ID参数,或者通过在 org.eclipse.ui.IWorkbenchPage中使用showView()/ hideView()API code>

You make the view visible/invisible at runtime using the org.eclipse.ui.IWorkbenchCommandConstants.VIEWS_SHOW_VIEW command and the view ID parameter, or by using the showView()/hideView() API in org.eclipse.ui.IWorkbenchPage

请参阅插入工作台了解更多信息。

这篇关于如何控制在Eclipse Editor中选择特定文件类型的视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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