How to control a View on selecting particular File Type in Eclipse Editor

≡放荡痞女 提交于 2019-12-25 01:45:56

问题


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.


回答1:


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.

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

See Plugging into the Workbench for more information.



来源:https://stackoverflow.com/questions/8265534/how-to-control-a-view-on-selecting-particular-file-type-in-eclipse-editor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!