Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » enabledWhen + menus without commands
enabledWhen + menus without commands [message #733442] Tue, 04 October 2011 14:24 Go to next message
sielver Missing name is currently offline sielver Missing name
Messages: 39
Registered: September 2011
Member
Hello,

So I'm starting to get familiar with how the menus, commands and handlers work together and how the activeWhen, enabledWhen and visibleWhen properties function.

However, I cannot seem to find a way to have a menu disabled. Say I have that "New" menu containing commands such as "New Square", "New Triangle", etc. I can make these commands disabled by using enabledWhen on their handlers.

Thing is I would like the "New" menu itself to be greyed out (disabled) when all its subitems (commands) are disabled, and I cannot figure out how. Menus only seem have a visibleWhen property.

Is there any way to achieve this?

Short version of the above: can't a menu (as in menu defined in a menuContribution) be disabled when it's not linked to a command?

Thanks in advance.

Jérémy

[Updated on: Wed, 05 October 2011 07:01]

Report message to a moderator

Re: enabledWhen + menus without commands [message #734217 is a reply to message #733442] Fri, 07 October 2011 02:21 Go to previous messageGo to next message
sielver Missing name is currently offline sielver Missing name
Messages: 39
Registered: September 2011
Member
No one?
Re: enabledWhen + menus without commands [message #753652 is a reply to message #734217] Fri, 28 October 2011 04:15 Go to previous message
Matthieu Lentwojt is currently offline Matthieu Lentwojt
Messages: 6
Registered: February 2011
Junior Member
If menu has no commands, it will be unvisible.
If menu has commands which aren't handled, the menu will not be visible.
If menu has at least one command which is handled (even disabled) , the menu will be shown.

Previous Topic:resetting all mementos?
Next Topic:cannot add view via Extension wizard
Goto Forum:
  


Current Time: Thu Jul 31 15:57:43 EDT 2014

Powered by FUDForum. Page generated in 0.05327 seconds