[Eclipse RCP] 1. 一个简单的RCP程序示例
创建第一个RCP项目
New - Plugin Project
设置其ID、版本号、名称
取消选择Generate an activator
将Rich Client Application区域设为Yes
选择Hello RCP模板
生成的项目结构如下:
自动创建的代码会生成一个空界面,运行结果如图:
Eclipse默认用plugin manifest editor打开plugin.xml,主要有如下几个标签页:
1)Overview
显示项目基本信息,其中Test区域的按钮可快速启动或调试plugin程序。
2)Dependencies
可查看该插件所依赖的其他插件,例如本插件依赖于org.eclipse.core.runtime、org.eclipse.ui;
还可通过Dependency Analysis查看dependency hierarchy。
这部分内容实际是定义在MANIFEST.MF文件中:
这部分内容实际是定义在plugin.xml中的内容:
添加工具栏1)在WorkbenchWindowAdvisor中显示工具栏
添加状态栏1)在WorkbenchWindowAdvisor中显示状态栏
protected void fillTrayItem(IMenuManager trayItem) {trayItem.add(aboutAction);trayItem.add(exitAction);}