Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Help menu in RCP application not displaying(Even though I define and register the help actions and fill the menu)
Help menu in RCP application not displaying [message #721516] Fri, 02 September 2011 01:05 Go to next message
SBS  is currently offline SBS Friend
Messages: 57
Registered: January 2011
Member
I am trying to add a Help menu to my Eclipse 3.6.2 RCP application. I have the following code in my ApplicationActionBarAdvisor:

	@Override
	protected void makeActions(final IWorkbenchWindow window) {
		showHelpAction = ActionFactory.HELP_CONTENTS.create(window);
		register(showHelpAction);

		searchHelpAction = ActionFactory.HELP_SEARCH.create(window);
		register(searchHelpAction);

		dynamicHelpAction = ActionFactory.DYNAMIC_HELP.create(window);
		register(dynamicHelpAction);
	}

	@Override
	protected void fillMenuBar(final IMenuManager menuBar) {
		final MenuManager helpMenu = new MenuManager("&Help", IWorkbenchActionConstants.M_HELP);
		helpMenu.add(showHelpAction);
		helpMenu.add(searchHelpAction);
		helpMenu.add(dynamicHelpAction);
		helpMenu.add(new Separator());
	}


However, no Help menu is displayed when I run the application.

How can I get the Help menu to work?

Thanks,

-sbs
Re: Help menu in RCP application not displaying [message #721559 is a reply to message #721516] Fri, 02 September 2011 06:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by:

On 2011-09-02 03:05, SBS wrote:
> I am trying to add a Help menu to my Eclipse 3.6.2 RCP application. I
> have the following code in my ApplicationActionBarAdvisor:
>
> @Override
> protected void makeActions(final IWorkbenchWindow window) {
> showHelpAction = ActionFactory.HELP_CONTENTS.create(window);
> register(showHelpAction);
>
> searchHelpAction = ActionFactory.HELP_SEARCH.create(window);
> register(searchHelpAction);
>
> dynamicHelpAction = ActionFactory.DYNAMIC_HELP.create(window);
> register(dynamicHelpAction);
> }
>
> @Override
> protected void fillMenuBar(final IMenuManager menuBar) {
> final MenuManager helpMenu = new MenuManager("&Help",
> IWorkbenchActionConstants.M_HELP);
> helpMenu.add(showHelpAction);
> helpMenu.add(searchHelpAction);
> helpMenu.add(dynamicHelpAction);
> helpMenu.add(new Separator());
> }
>
> However, no Help menu is displayed when I run the application.
>
> How can I get the Help menu to work?

Your fillMenuBar implementation is defect, because it simply ignores the
given IMenuManager. You are creating a menu manager without attaching it
to the menu bar. Fix this to something like the following:

@Override
protected void fillMenuBar(final IMenuManager menuBar) {
menuBar.add(createHelpMenu());
}

where createHelpMenu looks something like

private MenuManager createHelpMenu() {
MenuManager helpMenu = new MenuManager("&Help",
IWorkbenchActionConstants.M_HELP);
helpMenu.add(showHelpAction);
helpMenu.add(searchHelpAction);
helpMenu.add(dynamicHelpAction);
helpMenu.add(new Separator());
return helpMenu;
}

HTH & Greetings from Bremen,

Daniel Krügler
Re: Help menu in RCP application not displaying [message #722250 is a reply to message #721559] Mon, 05 September 2011 07:03 Go to previous messageGo to next message
SBS  is currently offline SBS Friend
Messages: 57
Registered: January 2011
Member
OK, that works nicely - thanks.

Now, the menu displays but selecting Help Contents does nothing. I have created a different plug-in to contain my help content and added it as a dependency for my product but what do I need to do to link this product, the help menu and the help plug-in so that selecting the menu option automatically launches the help system?

Thanks,

-sbs
Re: Help menu in RCP application not displaying [message #722259 is a reply to message #722250] Mon, 05 September 2011 07:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by:

On 2011-09-05 09:03, SBS wrote:
> OK, that works nicely - thanks.
>
> Now, the menu displays but selecting Help Contents does nothing. I have
> created a different plug-in to contain my help content and added it as a
> dependency for my product but what do I need to do to link this product,
> the help menu and the help plug-in so that selecting the menu option
> automatically launches the help system?

You probably need to create a plugin_customization.ini file, where you
add this entry:

# The page to show in the content area when opening help.
org.eclipse.help.base/help_home=/your_help_plugin/contents/index.html

where "your_help_plugin" is a plugin provided by you that hosts your
help integration.

I strongly recommend to read an introductory article, like these ones:

http://www.eclipse.org/articles/article.php?file=Article-AddingHelpToRCP/index.html
http://www.vogella.de/articles/EclipseRCPHelpSystem/article.html

HTH & Greetings from Bremen,

Daniel Krügler
Re: Help menu in RCP application not displaying [message #722276 is a reply to message #722259] Mon, 05 September 2011 08:30 Go to previous messageGo to next message
SBS  is currently offline SBS Friend
Messages: 57
Registered: January 2011
Member
Thanks, I have read those tutorials but I *still* can't get it to work. Absolutely nothing happens when I choose an option from the Help menu. No errors, no messages, just nothing. This is driving me nuts, it shouldn't be this hard!

I have:

1. Created a plug-in to contain the help content.
2. Added in the plug-in dependencies required to display help to my product.
3. Added the help plug-in as a dependency in my product.
4. Created and successfully displayed the help menu.
5. Created a helpData.xml file to specify the help content sequencing.
6. Added the following to my plugin customisation file:

org.eclipse.help/HELP_DATA=helpData.xml
org.eclipse.help.base/help_home=/Help/html/toc.html

where "Help" is the name of the help content plug-in.

But still, nothing happens.

What am I missing??? I have no idea how to even debug this.
Re: Help menu in RCP application not displaying [message #722300 is a reply to message #722276] Mon, 05 September 2011 09:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by:

On 2011-09-05 10:30, SBS wrote:
> Thanks, I have read those tutorials but I *still* can't get it to work.
> Absolutely nothing happens when I choose an option from the Help menu.
> No errors, no messages, just nothing. This is driving me nuts, it
> shouldn't be this hard!
>
> I have:
>
> 1. Created a plug-in to contain the help content.
> 2. Added in the plug-in dependencies required to display help to my
> product.
> 3. Added the help plug-in as a dependency in my product.
> 4. Created and successfully displayed the help menu.
> 5. Created a helpData.xml file to specify the help content sequencing.
> 6. Added the following to my plugin customisation file:
>
> org.eclipse.help/HELP_DATA=helpData.xml
> org.eclipse.help.base/help_home=/Help/html/toc.html
>
> where "Help" is the name of the help content plug-in.
>
> But still, nothing happens.
>
> What am I missing??? I have no idea how to even debug this.

You did not describe what UI action you performed and what feedback you
expected. Does you action Help/Help Contents work, i.e. does the help
window open? If not, you probably missed to add all dependencies
necessary for presenting the help. See

http://wiki.eclipse.org/RCP_FAQ#Which_plug-ins_are_needed_for_the_Eclipse_Help_system.3F

for some tips. I think, you need com.ibm.icu as well.

If your dependencies are OK, the help contents should be presented. If
this is the case, you may not have assigned the help ids to the
corresponding controls. How to do this, should be explained in the
references I quoted.

HTH & Greetings from Bremen,

Daniel Krügler
Re: Help menu in RCP application not displaying [message #722456 is a reply to message #722300] Mon, 05 September 2011 20:29 Go to previous messageGo to next message
SBS  is currently offline SBS Friend
Messages: 57
Registered: January 2011
Member
When I try Help->Help Contents I get nothing.

Now, about dependencies, do I need to add the help-related dependencies just to my *product* or also to the MANIFEST.MF file for the project plug-in that *uses* the help (i.e. not the plug-in that defines the help)? I have just tried adding these dependencies to the main plug-in MANIFEST.MF in addition to the product and this is the result when I run the application:

!ENTRY org.eclipse.osgi 2 0 2011-09-06 06:12:40.203
!MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-09-06 06:12:40.203
!MESSAGE Bundle initial@reference:file:../../../../Workspace/MyProject/ was not resolved.
!SUBENTRY 2 au.edu.uow.nccc.ecoder 2 0 2011-09-06 06:12:40.203
!MESSAGE Missing required bundle org.eclipse.help.webapp_3.5.3.
!SUBENTRY 2 au.edu.uow.nccc.ecoder 2 0 2011-09-06 06:12:40.203
!MESSAGE Missing required bundle org.eclipse.help.ui_3.5.3.
!SUBENTRY 2 au.edu.uow.nccc.ecoder 2 0 2011-09-06 06:12:40.203
!MESSAGE Missing required bundle org.eclipse.help.appserver_3.1.400.
!SUBENTRY 2 au.edu.uow.nccc.ecoder 2 0 2011-09-06 06:12:40.203
!MESSAGE Missing required bundle au.edu.uow.nccc.ecoder.help_1.0.0.
!SUBENTRY 2 au.edu.uow.nccc.ecoder 2 0 2011-09-06 06:12:40.203
!MESSAGE Missing required bundle org.eclipse.help.base_3.5.3.

When I do this it appears that even the help plug-ins cannot be found although I get no such problems when I only add them into the product's dependencies. Does this mean that I need to add even more dependencies to my plug-in's MANIFEST.MF or that I shouldn't be adding *any* help-related plug-ins to it? The tutorials are extremely vague on this point. Also, are all these help-related plug-ins supposed to be added to *both* the plug-in where the help is defined *and* the main plug-in which displays the help? Again, the tutorials are vague on this point.
Re: Help menu in RCP application not displaying [message #722541 is a reply to message #722456] Tue, 06 September 2011 05:48 Go to previous message
Eclipse UserFriend
Originally posted by:

On 2011-09-05 22:29, SBS wrote:
> When I try Help->Help Contents I get nothing.

OK, this is a clear evidence that your dependencies aren't yet satisfied.

> Now, about dependencies, do I need to add the help-related dependencies
> just to my *product* or also to the MANIFEST.MF file for the project
> plug-in that *uses* the help (i.e. not the plug-in that defines the
> help)?

Since you are not using any programmatic help API (I assume), you don't
need to add plugin dependencies, but it is of course important that the
missing dependencies are part of your product.

> I have just tried adding these dependencies to the main plug-in
> MANIFEST.MF in addition to the product and this is the result when I run
> the application:
>
> !ENTRY org.eclipse.osgi 2 0 2011-09-06 06:12:40.203
> !MESSAGE One or more bundles are not resolved because the following root
> constraints are not resolved:
> !SUBENTRY 1 org.eclipse.osgi 2 0 2011-09-06 06:12:40.203
> !MESSAGE Bundle initial@reference:file:../../../../Workspace/MyProject/
> was not resolved.

What is this? This looks definitively wrong, because this does not look
like a "normal" bundle dependency.

> When I do this it appears that even the help plug-ins cannot be found
> although I get no such problems when I only add them into the product's
> dependencies. Does this mean that I need to add even more dependencies
> to my plug-in's MANIFEST.MF or that I shouldn't be adding *any*
> help-related plug-ins to it?

I don't know, but above error message about some

initial@reference:file:../../../../Workspace/MyProject/

looks wrong. If you want to find out your dependencies, I recommend to
start your launcher within the Eclipse IDE (Run>Run Configurations...)
and all your dependencies there. There also exists a button "Select
Required" on the tab "Plug-ins", but this can only recognize *explicit*
dependencies, so you probably need to add the aforementioned plugins
manually to this list.

HTH & Greetings from Bremen,

Daniel Krügler
Previous Topic:Is this a bug about setFilter method in TableViewer?
Next Topic:Keyboard shortcut for Exit menuItem in RCP not behaving consistently across locale
Goto Forum:
  


Current Time: Fri Dec 19 16:31:33 GMT 2014

Powered by FUDForum. Page generated in 0.03028 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software