开发Eclipse RCP应用程序 [英] Developing an Eclipse RCP application

查看:159
本文介绍了开发Eclipse RCP应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我第一次使用Eclipse 3.8开发RCP应用程序。
我的问题可能看起来很奇怪,但对我来说真是令人困惑。我在哪里可以将代码放在我的应用程序中?如果我为我的应用程序创建了需要的类,我可以在哪里使用它们的对象?在 Application.java 类中?我很困惑,互联网教程只关注视觉和SWT,而不是关于如何编码。

It's my first time to develop an RCP application with Eclipse 3.8. My question may seem weird but it is really confusing for me. Where can I put the code for my application? If I create the needed classes for my app where can I use their objects? In the Application.java class? I'm confused, and Internet tutorials focus only on the visual aspect and SWT, not on how to code.

推荐答案

RCP应用程序基本上是一个eclipse插件。

An eclipse RCP application is basically an eclipse plugin.

我建议您使用基于简单模板(例如,Hello World模板)的RCP应用程序开始。要创建这样的应用程序,请创建一个新的插件项目(新建>其他>插件项目),将目标平台设置为Eclipse 3.8,让Wizard生成一个Activator,勾选该插件将为UI做出贡献和要创建富客户端应用程序:是,然后在下一个向导页面上选择任何可用的模板。

I suggest starting off with an RCP application based on a simple template (e.g., the Hello World template). To create such an application, create a new plug-in project (New > Other > Plug-in Project), set the target platform to Eclipse 3.8, let the Wizard generate an Activator, tick the checkboxes "This plug-in will make contributions to the UI" and "Would you like to create a rich client application: Yes", and choose any of the available templates on the next wizard page.

仔细看看生成的类。您正确地假设基本上 Application.java 是应用程序的起点。但是,请注意,Eclipse插件是一个OSGi(兼容)包,因此还有插件/捆绑激活器。还有一点要注意的是,一般配置点之一是 plugin.xml 及其扩展标签。

Have a good look at the generated classes. You're right in assuming that basically Application.java is the starting point of your application. However, note that an Eclipse plug-in is an OSGi(-compliant) bundle, so there's also the plug-in/bundle activator. Something to also keep in mind is that one of the general configuration points is the plugin.xml and its extensions tab.

我建议你看一些可用的教程(有一些可以帮助你开始,而不仅仅是专注于图形级别,尽管你自己习惯了很重要,例如SWT和JFace API)。从McAffer等人 Eclipse RCP书中我亲自获得了很多

I suggest that you have a good look at some of the tutorials available (there are a few which help you get started without just focusing on the graphics level, although it is important that you get yourself accustomed to, e.g., the SWT and JFace APIs). I personally gained a lot from reading McAffer et al.s Eclipse RCP book.

有一个博客post列出了许多选项以开始使用Eclipse RCP 。 (免责声明:无耻的自我推销)

There is a blog post which lists a number of options to get started with the Eclipse RCP. (Disclaimer: Shameless self-promotion)

希望这有帮助。

这篇关于开发Eclipse RCP应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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