RCP开发 问题解决

来源:互联网 发布:电子书软件 编辑:程序博客网 时间:2024/05/29 07:33
 
RCP开发 问题解决
 
 
1、配置文件
<extension
         point="org.eclipse.ui.editors">
            <editor
            class="com.filemanager.views.ToolList"
            id="com.inventec.itcnd.ui.filemanager.views.ToolList"
            name="TOOLS List"
            icon=""
            />
   </extension>

注意icon这个属性必须有但是可以什么都不写,即为“空串”
如果没有icon这个属性在显示edit的时候会报PartInitException: Unableto open editor, unknown editor ID.
2、editpart class 的init方法必须写
    @Override
    public void init(IEditorSite site, IEditorInput input)
            throws PartInitException {
        // Initialize the editor part
        this.setSite(site);
        this.setInput(input);
    }   
否则会报PartInitException: Editor initialization failed:Site is incorrect
原创粉丝点击