如何将带有透视图和视图的插件添加到我自己的 RCP 应用程序中
我有一个非常基本的 RCP 应用程序 (e3.7.1),只有一个 (Hello World) 插件。出于代码控制的原因,我想在单独的插件中开发所有视角和视图。我现在已经设置了一个带有透视图和视图的插件。如何将它们放入我的主 RCP 插件中,例如,在哪里配置哪些扩展/扩展点?我希望透视图和视图也出现在透视图菜单中。
I have a very basic RCP application (e3.7.1) with only one (Hello World) plugin. For reasons of code control I want to develop all perspectives and views in separate plugins. I have now set up one plugin with a perspective and a view. How do I get them into my main RCP plugin, e.g., where do I configure which extensions/extension points? I want the perspective and view to appear in the Perspective Menu as well.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是如何创建 RCP 应用程序的?您是否创建了 .product 定义?你创建了一个功能吗?
基本上 Eclipse 是基于插件(OSGI 包)的,您可以在不同的插件中创建视图和透视图。只要您的插件是 RCP .product 定义的一部分(作为普通插件或功能定义),您就应该能够使用所有所需的插件导出 RCP 应用程序。
如果您只是谈论如何从 Eclipse 运行它们,则需要编辑运行配置并在 Eclipse 应用程序运行配置中添加需要激活的所有插件。此配置用于启动 RCP 应用程序。
How did you create you RCP application, did you create a .product definition ? did you create a feature ?
Basically Eclipse is based around plugins (OSGI bundles) and you can create view and perspective in different plugins. As long as your plugin is part of you RCP .product definition either as a plain plugin or into a feature definition, you should be able to export your RCP application with all the desired plugins.
If you are just talking about how to run them from Eclipse, you need to edit the run configuration and add all the plugin you need to activate in the Eclipse Application run configuration. This configuration is the on you use to launch the RCP application.
这些菜单中的视图和透视快捷方式集特定于当前透视。
如果您想要使用这些快捷方式的视角是您自己的,那么您需要调用
IPageLayout
方法addShowViewShortcut()
和来自IPerspectiveFactory
。如果您想让这些快捷方式在其他人的角度可用,请使用 org.eclipse.ui.perspectiveExtensions 扩展点。The set of view and perspective shortcuts in those menus is specific to current perspective.
If the perspective on which you want to make those shortcuts available is your own, then you need to call
IPageLayout
methodsaddShowViewShortcut()
andaddPerspectiveShortcut()
from yourIPerspectiveFactory
. If you want to make those shortcuts available on someone else's perspective then use org.eclipse.ui.perspectiveExtensions extension point.