Linking Help to the Menu

This page describes the basic steps in linking a sample Help project to the Contact Manager sample RCP application.

This tutorial requires the Contact Manager project and a Help project. If you have not done so already, please see the Generating a Sample RCP Application and Creating a New Help Project tutorials.

  1. Add the Help Contents menu item.
  2. Add the Plug-in Dependencies.

1. Add the Help Contents menu item

First you need to define the action that is called when the user invokes the Help > Help Contents menu item.

Open the com.instantiations.contactmanger package and double-click ApplicationActionBarAdvisor to open it.

Add a field:  private IWorkbenchAction helpContentsAction;

In the method, protected void makeActions(final IWorkbenchWindow window), add the following code:

helpContentsAction= ActionFactory.HELP_CONTENTS.create(window);
register(
helpContentsAction);

In the method, protected void fillMenuBar(IMenuManager menuBar) , add the following code just above the aboutAction:

helpMenu.add(helpContentsAction);

 

Save your changes.

Test the application to make sure the Help Contents menu has been properly added.

You should now see the Help Contents menu item under the Help menu. If you click the Help Contents menu item, it won't do anything yet.



2. Add the Plug-in Dependencies

Open the MANIFEST file in com.instantiations.contactmanger project and switch to the Dependencies tab.  Click the Add button and add the following plug-ins:
  • com.instantiations.contactmanager.help
  • org.eclipse.help
  • org.eclipse.help.appserver
  • org.eclipse.help.base
  • org.eclipse.help.ui
  • org.eclipse.help.webapp
  • org.eclipse.tomcat
Save your changes.



Open the configuration file, contactmanager.product, click the Configuration tab and click the Add Required Plug-ins button.
Save your changes.



With the contactmanager project selected, select Run > Run... menu to open the launch configuration.
Select the Plug-ins tab, click the Add Required Plug-ins button and click Run.



The Contact Manager application opens.



Select Help > Help Contents.
The Eclipse Help System opens and you should now see the Contact Manager Guide under the Contents section.