一、一个plugin中只有一个applicationhtml
二、rcp4中的application不用本身写类实现,已经包含在application。xmi文件中java
三、rcp3建立的项目在rcp4中能够接着开发。缓存
四、perpective添加view不显示app
若是在开发中发现,没有打包发布以前,如论运行application或product方式,若是setSaveAndRestore设置为true那么只能看到welcome视图而不能看见我所建立的view, 可是setSaveAndRestore将setSaveAndRestore改为false就能够了,因此笔者建议:在开发的时候将参数指定为false, 到发布的时候改为true.
五、在run configureation中配置clear缓存,否则更改没有效果eclipse
六、Rcp添加菜单和工具栏:工具
经过command添加菜单和工具栏(action的不利于分离已经out) http://www.itkeyword.com/doc/0732274388348506x155 还能够经过代码进行加载,设置ApplicationActionBar类进行设置。经过代码显示action没有效果的话,须要检查ApplicationWindowWorkbenchAdvisor里面的 createActionBar方法返回的是否是本身设计的类。
七、rcp3中没有在application.xmi文件须要本身实例化appclition这个类来进行初始化操做。所以part也须要在extension中添加views的拓展。类事项ViewPart这个父类来完成view的显示。ui
八、Rcp在打包时出现.net
In plugin com.example.wotrd.hyperbola, the value for property source.@dot is not set. 这个错误,首先检查build.properties,看是否是有没有加载的,将source.. = 使用 source.. = src/替换
九、打开打包完的项目,首先会弹出控制台,设计
将打包完项目的ini文件打开,将-consoleLog删除,从新打开就行了。
十、新定义的properties文件找不到:code
在META-INFO的Manifest.mf文件中添加: Bundle-Localization: plugin
十一、JAVAClean project以后报错:java.lang.RuntimeException: No application id has been found.
https://www.cnblogs.com/chenyongblog/p/4981549.html
十二、给rcp的导航的某个节点使用command添加节点,只在本节点上。右键上下文菜单。 参考连接:http://blog.csdn.net/soszou/a...
在plugin。xml文件中,添加command,而后,添加handler,handler也控制菜单的显示状况。
能够使用instanceof和adapt来控制显示状况。还有and和or等判断条件
例如:
<command
commandId="org.eclipse.ui.edit.indexrebuild"
label="%command.org.eclipse.ui.edit.indexrebuild.name">
<visibleWhen checkEnabled="true"/>
</command>
command包含在<menuContribution allPopups="false" locationURI="popup:org.eclipse.ui.popup.any?after=navigator_additions">
<handler commandId="org.eclipse.ui.edit.indexrebuild" class="org.jkiss.dbeaver.ui.actions.navigator.NavigatorHandlerObjectDelete">
<enabledWhen> <with variable="selection"> <count value="1"/> <iterate operator="and"> <and> <instanceof value="org.jkiss.dbeaver.model.navigator.DBNNode"/> <adapt type="org.jkiss.dbeaver.model.struct.rdb.DBSTableIndex"/> </and> </iterate> </with> </enabledWhen>
</handler>
重点:使用adapt须要声明:
以下: <extension point="org.eclipse.core.runtime.adapters"> <factory adaptableType="org.jkiss.dbeaver.model.DBPObject" class="org.jkiss.dbeaver.ui.navigator.NavigatorAdapterFactory"> <adapter type="org.jkiss.dbeaver.model.DBSTableIndex"/>
1三、添加对话框,使用resourceundle的字符串。参考deletehandler的部分使用方法:
DBeaverActivator.getCoreResourceBundle().getString(ConfirmationDialog.RES_CONFIRM_PREFIX + objectType + "_" + ConfirmationDialog.RES_KEY_TITLE); 使用前缀-中间-后缀进行拼凑。组成一个字符串也就是key从CoreResources.properties文件中进行获取。 步骤: 1.在CoreResources.properties文件中定义参数:定义的时候须要根据ConfirmDialog的拼凑格式起名字。 confirm_index_rebuild_title = Index Rebuild confirm_index_rebuild_message = Will you rebuild the index, ok? 2.在DBeaverPreferences文件中添加常量indexrebuild,使用DBeaverActivator.xxx就能够进行获取。 3.解决中英文国际化问题