Menu contributions grayed out in 3.3 [message #467312] |
Wed, 02 May 2007 16: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 #467723 is a reply to message #467312] |
Thu, 10 May 2007 09:15  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03208 seconds