描述资源路径位置类型 MODE_INFOCENTER 无法解析或不是字段

问题描述 投票:0回答:1

我正在创建一个启用了帮助插件的 RCP 应用程序。我在 ApplicationWorkbenchAdvisor 类中添加了运行帮助的代码,但出现以下错误:

Description Resource    Path    Location    Type
MODE_INFOCENTER cannot be resolved or is not a field    ApplicationWorkbenchAdvisor.java    /First RCP Application/src/first/rcp/application    line 24 Java Problem

我所有的代码:

package first.rcp.application;

import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.help.HelpSystem;
import org.eclipse.ui.application.WorkbenchAdvisor;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;

public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {

    private static final String PERSPECTIVE_ID = "first.rcp.application.perspective"; 

    @Override
    public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
        return new ApplicationWorkbenchWindowAdvisor(configurer);
    }
    
    @Override
    public String getInitialWindowPerspectiveId() {
        return PERSPECTIVE_ID;
    }
    @Override 
    public void postWindowOpen(IWorkbenchWindowConfigurer configurer) {
        HelpSystem.setMode(HelpSystem.MODE_INFOCENTER); 
    }
}
eclipse eclipse-plugin eclipse-rcp
1个回答
0
投票

BaseHelpSystem.MODE_INFOCENTER
,而不是
HelpSystem.MODE_INFOCENTER
(并且
HelpSystem
不会扩展
BaseHelpSystem
)。

© www.soinside.com 2019 - 2024. All rights reserved.