Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Menu contributions grayed out in 3.3
Menu contributions grayed out in 3.3 [message #467312] Wed, 02 May 2007 20:48 Go to next message
Eclipse UserFriend
Originally posted by: nillism3.yahoo.com

I have been trying to integrate the new command/handler/menu
contribution scheme in one of our products. I thought I had the concept
down until I hit the following issue: all the menu and toolbar entries
that I create declaratively show up grayed out by default. I didn't do
anything special to change the visibility of the menu items, thinking
that by default they would be visible.

For instance, one of my entries is defined as follows:

<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="menu:window?after=additions">
<command
commandId="rcp.openConsole"
icon="icons/monitor.gif"
id="rcp.openConsole"
label="Open Console"
style="push"
tooltip="Open the console view">
</command>
</menuContribution>
...
</extension>

<extension
point="org.eclipse.ui.handlers">
<handler
class="rcp.handlers.OpenConsoleHandler"
commandId="rcp.openConsole">
</handler>
</extension>

<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="menu:window?after=additions">
<command
commandId="rcp.openConsole"
icon="icons/monitor.gif"
id="rcp.openConsole"
label="Open Console"
style="push"
tooltip="Open the console view">
</command>
</menuContribution>
...
</extension>

Is there something wrong with this? I am using 3.3M5eh.
Thanks!
Re: Menu contributions grayed out in 3.3 [message #467417 is a reply to message #467312] Thu, 03 May 2007 15:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nillism3.yahoo.com

A short follow-up on this: the action I showed in the example shows up
grayed out by default. However, if I register() a dummy action with the
same id (in this case "rcp.openConsole") in my
ApplicationActionBarAdvisor, then the action created declaratively is
enabled.

Am I missing a step somewhere? I doubt this is the way it's supposed to
be working, since having to manually register all declared actions
defeats the purpose.

Thanks!

Chris Cross wrote:
> I have been trying to integrate the new command/handler/menu
> contribution scheme in one of our products. I thought I had the concept
> down until I hit the following issue: all the menu and toolbar entries
> that I create declaratively show up grayed out by default. I didn't do
> anything special to change the visibility of the menu items, thinking
> that by default they would be visible.
>
> For instance, one of my entries is defined as follows:
>
> <extension
> point="org.eclipse.ui.menus">
> <menuContribution
> locationURI="menu:window?after=additions">
> <command
> commandId="rcp.openConsole"
> icon="icons/monitor.gif"
> id="rcp.openConsole"
> label="Open Console"
> style="push"
> tooltip="Open the console view">
> </command>
> </menuContribution>
> ...
> </extension>
>
> <extension
> point="org.eclipse.ui.handlers">
> <handler
> class="rcp.handlers.OpenConsoleHandler"
> commandId="rcp.openConsole">
> </handler>
> </extension>
>
> <extension
> point="org.eclipse.ui.menus">
> <menuContribution
> locationURI="menu:window?after=additions">
> <command
> commandId="rcp.openConsole"
> icon="icons/monitor.gif"
> id="rcp.openConsole"
> label="Open Console"
> style="push"
> tooltip="Open the console view">
> </command>
> </menuContribution>
> ...
> </extension>
>
> Is there something wrong with this? I am using 3.3M5eh.
> Thanks!
Re: Menu contributions grayed out in 3.3 [message #467723 is a reply to message #467312] Thu, 10 May 2007 13:15 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Chris Cross wrote:
> I have been trying to integrate the new command/handler/menu
> contribution scheme in one of our products. I thought I had the concept
> down until I hit the following issue: all the menu and toolbar entries
> that I create declaratively show up grayed out by default. I didn't do
> anything special to change the visibility of the menu items, thinking
> that by default they would be visible.
>
> For instance, one of my entries is defined as follows:
>
> <extension
> point="org.eclipse.ui.menus">
> <menuContribution
> locationURI="menu:window?after=additions">
> <command
> commandId="rcp.openConsole"
> icon="icons/monitor.gif"
> id="rcp.openConsole"
> label="Open Console"
> style="push"
> tooltip="Open the console view">
> </command>
> </menuContribution>
> ...
> </extension>
>
> <extension
> point="org.eclipse.ui.handlers">
> <handler
> class="rcp.handlers.OpenConsoleHandler"
> commandId="rcp.openConsole">
> </handler>
> </extension>
>
> <extension
> point="org.eclipse.ui.menus">
> <menuContribution
> locationURI="menu:window?after=additions">
> <command
> commandId="rcp.openConsole"
> icon="icons/monitor.gif"
> id="rcp.openConsole"
> label="Open Console"
> style="push"
> tooltip="Open the console view">
> </command>
> </menuContribution>
> ...
> </extension>
>

You have the same menu item defined twice (is that just for example
purposes?).

Do you have the command defined in org.eclipse.ui.commands? You need
that as well.

There are still some bugs in 3.3M5eh (and 3.3M6), you should try your
example against 3.3M7.

3.3M7 also includes a Hello World command contribution template (from
the new project wizard or adding an org.eclipse.ui.commands extension
point) that can generate an example using org.eclipse.ui.commands,
handlers, bindings, and menus.

Later,
PW


Previous Topic:How to acess native libraries (dlls on Windows) from a plugin?
Next Topic:Creating SWT context menu in Swing Controls.
Goto Forum:
  


Current Time: Fri Apr 26 18:16:42 GMT 2024

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

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

Back to the top