eclipseeclipse-plugineclipse-rcp

Description Resource Path Location Type MODE_INFOCENTER cannot be resolved or is not a field


I am creating an RCP application with the help plugin enabled. I added the code to run the help in the ApplicationWorkbenchAdvisor class, but I got the following error:

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

All my code:

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); 
    }
}

Solution

  • It's BaseHelpSystem.MODE_INFOCENTER, not HelpSystem.MODE_INFOCENTER (and HelpSystem does not extend BaseHelpSystem).

    If you look into the class HelpSystem, there is no constant or something else called MODE_INFOCENTER, so the error message "MODE_INFOCENTER cannot be resolved or is not a field" is correctly shown.