Eclipse 菜单中的显示视图 Window->显示视图
“我创建了一个 Eclipse 插件,它在 Eclipse 中创建一个视图。目前它在 Eclipse 菜单中显示为: '窗口->显示视图->其他'。
我想在“窗口 ->”中显示它显示视图”而不是在子菜单“其他”下。
我已经尝试将plugin.xml 文件中视图的“类别”指定为“org.eclipse.ui”,但它仍然在“其他”子菜单中显示视图。
还有其他方法吗?任何建议在这方面都有帮助。
提前致谢, 阿比纳夫”
"I have created an Eclipse plugin which creates a view in Eclipse. Currently it is displayed in the Eclipse menu as :
'Window->Show View->Others'.
I want to show it in 'Window -> Show View' and not under the submenu 'Others'.
I have tried it giving the 'Category' of the view in the plugin.xml file as 'org.eclipse.ui' but it is still showing the view in 'Others' submenu.
Is there any other way to do so? Any suggestions are helpful in this regard.
Thanks in advance,
Abhinav"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为你可以通过定制的视角来做到这一点。
在您的plugin.xml 中,添加“org.eclipse.ui.perspectives”的扩展点,并创建一个实现IPerspectiveFactory 的新类。
这个类有一个方法“createInitialLayout(IPageLayout布局)”,在该布局上您可以调用“layout.addShowViewShortcut(<您的视图的ID>)”
您还可以在那里添加向导等的快捷方式。
希望有帮助,
安德烈亚斯
I think you can do that with a customized perspective.
In your plugin.xml, add an extension point for "org.eclipse.ui.perspectives", and create a new class implementing IPerspectiveFactory.
This class has a method "createInitialLayout( IPageLayout layout )", and on that layout you can call "layout.addShowViewShortcut( < ID of your view > )"
You can also add shortcuts for wizards etc. there.
Hope that helps,
Andreas
您还可以阅读关于 eclipse 的“透视文章”:
You can also read the "Perspective Article" on eclipse:
当此类快捷方式应添加到现有透视图时,提供视图、新文件向导或透视图的插件可以声明 org.eclipse.ui.perspectiveExtensions 的扩展名。透视图,例如 org.eclipse.jdt.ui.JavaPerspective、org.eclipse.emf.ecoretools.perspective 或 org.eclipse.ui.resourcePerspective code> 可以扩展以提供新向导、视图、透视快捷方式等。
When shortcuts of such kind shall be added to an existing perspective, the plugin providing views, new file wizards, or perspectives may declare an extension to
org.eclipse.ui.perspectiveExtensions
. Perspectives such asorg.eclipse.jdt.ui.JavaPerspective
,org.eclipse.emf.ecoretools.perspective
, ororg.eclipse.ui.resourcePerspective
can be extended to provide new-wizard, view, perspective shortcuts and more.