如何重新使用一些“Eclipse IDE 插件"来创建 Eclipse RCP 应用程序? [英] How to create an Eclipse RCP application re-using some "Eclipse IDE plugins"?

查看:38
本文介绍了如何重新使用一些“Eclipse IDE 插件"来创建 Eclipse RCP 应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何创建一个 RCP 应用程序,它看起来与 Eclipse IDE 完全一样,具有所有菜单、视图、对话框...?

How can I create a RCP application, which looks exactly like the Eclipse IDE with all menus, views, dialogs...?

这里是一个例子:http:///richclientplatform.blogspot.com/2007/12/oil-and-gas-industry-using-eclipse.html

我按照 Lars Vogel 的教程创建了一个简单的 RCP 应用程序:http://www.vogella.de/articles/EclipseRCP/article.html.

I followed Lars Vogel's tutorial to create a simple RCP application: http://www.vogella.de/articles/EclipseRCP/article.html.

...接下来的步骤是什么?

推荐答案

ide 包为您提供了允许您使用工作区隐喻的类和扩展点,但它不包括添加所有功能的扩展在 Eclipse IDE 中查看.

The ide bundle provides you with classes and extension points that allow you to use the workspace metaphor but it does not include the extensions that add all the functionality that you would see in the Eclipse IDE.

由于 RCP 应用程序应用程序中的每个包都添加了菜单、视图和对话框,因此使您的应用程序看起来像 IDE 的方法是包含 IDE 附带的所有包.

Since each bundle in an RCP app application adds menu, views, and dialogs the way to get your application to look like the IDE is to include all of the bundle that come with the IDE.

通常你从一个非常简单的应用程序开始,比如 Vogel(我发现他提供了很好的教程)描述的教程.然后,当您找到要添加的内容时,请研究提供它的包并添加该包.当您这样做时,您的应用程序的功能将增加,而不会获得用户不需要的功能.

Usually you start with a pretty bare application like something tutorials that Vogel (who I find puts out good tutorials) puts out describe. Then when you find something that you want to add you research which bundle provides it and you add that bundle. As you do this your application will grow in functionality without picking up functionality your user does not need.

让我引导您创建一个简单的 RCP 应用程序.

Let me walk you through creating a simple RCP application.

  • 通过转到文件 -> 新建 -> 项目来创建一个新项目
  • 选择插件项目
  • 将项目名称设置为 com.mydomain.rcp
  • 点击下一步
  • 在富客户端应用程序下选择是
  • 点击下一步
  • 选择 RCP 邮件模板
  • 点击完成

您现在拥有一个具有某些功能的 RCP 应用程序.接下来我们将运行它:

You now have an RCP app with some functionality. Next we will run it:

  • 选择运行 -> 运行配置...
  • 选择左侧的 Eclipse 应用程序
  • 右键单击并选择新建
  • 寻找运行/运行产品的程序.选择 com.mydomain.rcp.product
  • 点击插件标签
  • 在顶部找到 Launch 并选择仅在下方选择的插件
  • 点击右侧的取消全选
  • 在你的插件列表中选择 com.mydomain.rcp
  • 在底部取消选择自动将新工作区插件添加到此启动配置
  • 右击添加所需插件
  • 点击底部的运行

应用程序应该正在运行示例邮件应用程序.继续关闭它.现在让我们添加一个插件,这样我们就可以像在 Eclipse IDE 中一样显示搜索菜单​​.

The application should be running the sample mail application. Go ahead and close it down. Now let's add a plugin so we can get the Search menu to show up like it does in the Eclipse IDE.

  • 在您的 com.mydomain.rcp 项目中打开您的 plugin.xml 文件
  • 单击依赖项"选项卡
  • 在所需插件下单击添加...
  • 输入 org.eclipse.search
  • 选择 org.eclipse.search(不是源代码)
  • 点击确定
  • 保存 plugin.xml 文件
  • 从菜单中选择运行 -> 运行配置...
  • 点击插件标签
  • 右击添加所需插件
  • 点击底部的运行

您现在应该看到带有文件搜索选项的搜索菜单,就像 IDE 一样.您不会看到 Java 搜索或插件搜索,因为我们没有添加包含这些添加的适当 JDT 或 PDE 插件.希望这能让您了解如何添加新插件.

You should now see the Search menu with the File Search option just like the IDE has. You will not see the Java Search or the Plug-in Search though because we did not add the appropriate JDT or PDE plugins containing those additions. Hopefully this gives you an idea how to add new plugins.

这篇关于如何重新使用一些“Eclipse IDE 插件"来创建 Eclipse RCP 应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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