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 .eclipse.ui.application.IWorkbenchWindowConfigurer;
import .eclipse.help.HelpSystem;
import .eclipse.ui.application.WorkbenchAdvisor;
import .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);
}
}
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 .eclipse.ui.application.IWorkbenchWindowConfigurer;
import .eclipse.help.HelpSystem;
import .eclipse.ui.application.WorkbenchAdvisor;
import .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);
}
}
Share
asked Nov 19, 2024 at 19:43
AlienAlien
33 bronze badges
1 Answer
Reset to default 0It'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.