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

查看:42
本文介绍了开发 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.

推荐答案

一个 Eclipse RCP 应用程序基本上是一个 Eclipse 插件.

An eclipse RCP application is basically an eclipse plugin.

我建议从基于简单模板(例如 Hello World 模板)的 RCP 应用程序开始.要创建这样的应用程序,请创建一个新的插件项目(New > Other > Plug-in Project),将目标平台设置为 Eclipse 3.8,让向导生成一个 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(-compliant) 包,因此还有插件/包激活器.还要记住的是,一般配置点之一是 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.

有一个 博客文章列出了一些获取选项从 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天全站免登陆