RCP基础总结

申明:转载他人文章,做为自己学习收集资料,见谅!
RCP基础总结
<script></script>
1.简介

Rich client platform 富客户端平台:应用于JAVA桌面程序开发;
一个Eclipse插件:
Eclipse插件:普通插件(对宿主的扩展);
脱离Eclipse框架独立运行;
与J2EE(jsp,Servlet,ejb)完整结合;
目前,国内 RCP 应用也逐渐发展和壮大起来, RCP 有希望扭转Java桌面应用的颓势。如 Jlibrary 是一款开源的 CMS 系统,就是 Eclipse RCP的典型应用,还有Nomad PIM(个人信息管理软件),ETC…。

2.RCP体系结构

RCP就是一个简化了的eclipse平台,它只包含5个插件:
runtime是核心类,
osgi是定义的一个标准,用来规范不同的插件,让他们可以相互协作。
剩下的三个插件Workbench、SWT、JFace是用来显示给用户界面的。



填充RCP框架的"血肉"(内容:) ):

1.Workbench
每个RCP应用程序,对应一个Workbench(工作台),应用程序的主窗体.

2.Perspective
模块化单元,一个Workbench可包含多个Perspective(透视图),各个透视图之间是相互独立的单元.
主要功能:布局视图

3.View
视图:主要负责信息的显示.一个透视图可包含一或多个视图.
特点:
可灵活布局于特定透视图,
作为一个独立的显示模块, 可重用

4.Editor
编辑器:信息编辑区域.一个透视图对应一个编辑器.
特点:可以与视图进行及时交互;方便用户编辑数据.

几个不得不知道的文件:

● src文件夹下为运行插件时的一些类文件。

● MANIFEST.MF为插件清单文件,是插件与外界沟通的桥梁。





MANIFEST.MF文件是保存OSGi 的 Bundle文件。该文件也就是与其他平台的接口,通过该接口,外部平台可以使用该Eclipse的插件程序。关键的key值所表示的意义:

Bundle-Name:插件的名称。

Bundle-SymbolicName:为插件的唯一标识。


Bundle-Activator:为主程序启动的类的全名。

Require-Bundle:系统编译和运行的依赖项,可以加入其他所必需的插件。


● build.properties文件为构建RCP程序时所导入的类库设置。
build.properties是保存构建、打包和导出插件所需的所有信息的文件。




● plugin.xml是最重要的文件,该文件是插件的配置文件,集中管理插件内部的运行,在该文件中可以查找所有与该插件有关的信息。



plugin.xml文件是插件开发中最重要的文件,包含声明插件的扩展和扩展点配置。
id="application",表示该扩展点的标识。
point="org.eclipse.core.runtime.applications",表示扩展点的类型。这里表示该扩展点是系统扩展点,例如另一个扩展点类型“org.eclipse.ui.perspectives”为透视图扩展点。
<run>子项中定义了系统启动的class类,为com.fengmanfei.myrcp.Application,可以在源文件下找到这个.java源文件。
对于不同的扩展点有不同的配置元素,读者可以参考Eclipse的帮助文档。

3.RCP运行基本原理

A 插件类MyRCPPlugin
系统运行后首先在MANIFEST.MF文件中找到Bundle-Activator所对应的插件类.该类主要创建整个插件的对象,是插件的全局对象。可以通过该类的静态方法获得插件对象的引用,然后获得插件的各种信息,包括插件所对应的Bundle文件信息、log日志对象和工作台对象等。


B应用程序类Application
创建了插件类后,如何来创建主窗口呢?Eclipse运行的程序都是通过扩展点来配置的,初始化的界面程序也不例外,也是在配置的插件文件中配置好的。创建了插件类后,程序会自动查找plugin.xml文件,是否有对应的应用程序扩展点org.eclipse.core. runtime. applications。如果有,再找到该运行程序所对应的class,然后创建对象。

C工作台窗口类
该类创建时首先对工作台进行设置。是在preWindowOpen方法中实现的。该方法会在窗口打开之前调用。另外,也可以通过覆盖父类中的方法来进行窗口打开之前的配置工作和窗口关闭的善后处理工作。

D操作类
创建窗口时,会创建菜单栏和工具栏,此时创建的是ApplicationActionBarAdvisor对象。在该类中,可以添加各种操作项来创建菜单栏、工具栏和状态栏等。

E透视图类
最后,在创建工作台对象时,要指定一个默认的透视图对象。要实现一个透视图类,就要实现IPerspectiveFactory接口。


4.RCP优势

A.开发效率相对较快;
B.界面简洁不失美观;
C.运行速度快;
D.跨平台;
E.与J2EE完整结合;
F.基于Internet布署,维护更加方便;
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Use of NWAI-WG data   So far, NWAI-WG data have been used on a collaborative basis in publications (see the attached file). The major reasons are the data were not widely distributed. They were only used in our group and our collaborative networks. There were some cases with requests of the data made after people read Liu and Zou's (2012) paper. You have two options for using the data. Option 1: Collaboration with us. In this case, we will help you to describe the downscaling method and contribute to other parts of the paper such as comments/suggestions on the papers, if the fields are within our expertise. Option 2: Use of the data on your own. While option 1 for collaboration with us is welcome, option 2 is also highly encouraged, particularly, when the data are used for these research disciplines, rather than agricultural related. Thanks to Professor Yu who provides us with his group's web site (www.agrivy.com) as a media for distribution of the data.   Acknowledgment for option 1  “We acknowledge the modelling groups, the Program for Climate Model Diagnosis and Intercomparison (PCMDI) and the WCRP’s Working Group on Coupled Modelling (WGCM) for their roles in making available the WCRP CMIP5 multi-model dataset. Support of this dataset is provided by the Office of Science, US Department of Energy. Dr. Ian Macadam of the University of New South Wales downloaded the raw GCM monthly data. ”   Acknowledgment for option 2  “We acknowledge the modelling groups, the Program for Climate Model Diagnosis and Intercomparison (PCMDI) and the WCRP’s Working Group on Coupled Modelling (WGCM) for their roles in making available the WCRP CMIP5 multi-model dataset. Support of this dataset is provided by the Office of Science, US Department of Energy. Dr. Ian Macadam of the University of New South Wales downloaded the raw GCM monthly data. Dr. De Li Liu of the NSW Department of Primary Industries used NWAI-WG to downscale downscaled daily data. Also, thanks to AGRIVY (www.agrivy.com) provides us the data for this study.”
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值