Menu contributions grayed out in 3.3 [message #467312] |
Wed, 02 May 2007 20:48 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
|
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
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
Powered by
FUDForum. Page generated in 0.03398 seconds