Eclipse RCP - 第一个RCP程序

Eclipse RCP (Rich Client Platform) 为Java桌面程序开发提供了一个基础平台, 基于该平台用户可以快速开发出一个具有很好扩展性的桌面程序, 我们使用的Eclipse实际上就是一个以Eclipse RCP为平台, 集成各种功能的插件的一个开发工具, Eclipse RCP的核心组件如下: ...

January 6, 2016 · 2 分钟 · 852 字

Eclipse 插件开发 - 实现外部程序修改文件后刷新功能

Eclipse在加载项目时, 会对文件进行缓存, 所以如果不是在Eclipse中编辑文件, 通过调用外部程序, 例如: 系统自带的文本编辑器, 对工程中的文件进行修改, 需要手动在Eclipse中刷新一下才能重新加载. ...

January 6, 2016 · 1 分钟 · 204 字

Eclipse 插件开发 - The resource tree is locked for modifications

实现效果: 监听Eclipse修改文件时, 同时更新某一个文件, 因为更新采用的是外部程序, 所以修改的时候需要调用Eclipse的方法Resources.refreshLocal重新加载这个文件. ...

December 22, 2015 · 1 分钟 · 488 字

Eclipse 插件开发 - 工具栏(tool bar)增加下来菜单

在开发Eclipse 插件时, 想在工具栏中增加一个按钮图标是非常容易, 但是想在图标上增加子菜单就会比较麻烦, 例如想实现如下效果: 具体步骤如下: 首先在扩展点org.eclipse.ui.commands中增加三个指令 <extension point="org.eclipse.ui.commands"> <command name="Reference Command" id="top.itart.plugin.smartboot.referenceCommand"> </command> <command name="Sub1 Command" id="top.itart.plugin.smartboot.sub1Command"> </command> <command name="Sub2 Command" id="top.itart.plugin.smartboot.sub2Command"> </command> </extension> 其次在扩展点org.eclipse.ui.menus 增加两个menuContribution <menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions"> <toolbar id="top.itart.plugin.smartboot.toolbars"> <command commandId="top.itart.plugin.smartboot.referenceCommand" icon="icons/sample.gif" tooltip="Pull down" style="pulldown"> </command> </toolbar> </menuContribution> 这个是定义显示在toolbar上的菜单. Command 中的commandId 为第一个指令的ID, 类型 type 为pulldown, 并且放在toolbar标签中 <menuContribution locationURI="menu:top.itart.plugin.smartboot.referenceCommand"> <command commandId="top.itart.plugin.smartboot.sub1Command" icon="icons/sample.gif" label = "Sub 1" tooltip="Sub 1"> </command> <command commandId="top.itart.plugin.smartboot.sub2Command" icon="icons/sample.gif" tooltip="Sub2" label = "Sub 2"> </command> </menuContribution> 这个menuContribution是定义下拉的子菜单. 注意locationURI的值是menu: <Toolbar上的菜单ID> ...

December 21, 2015 · 1 分钟 · 422 字

Eclipse 插件开发- 运行内存溢出

在插件开发时, 点击工程右键> Run As > Eclipse Application 出现内存溢出 2015-12-20 14:01:22 com.genuitec.pulse.client.deliverypackage.runtime.internal.Activator initializeLoggers 信息: Package starting up at Sun Dec 20 14:01:22 CST 2015 java.lang.OutOfMemoryError: PermGen space java.lang.OutOfMemoryError: PermGen space java.lang.OutOfMemoryError: PermGen space 分析 是因为java默认分配的内存过小, 只需要加大内存即可, 步骤如下: ...

December 20, 2015 · 1 分钟 · 111 字