|
|
|
|
|
Re: Submenu does not show up [message #636797 is a reply to message #636747] |
Tue, 02 November 2010 19:40 |
Alex Molochnikov Messages: 25 Registered: July 2009 |
Junior Member |
|
|
Sorry, but you lost me on this one.
I have a menu contribution where I list a number of items (commands).
The contribution's locationURI is
popup:#BaseMapViewPopup?after=additions. There is a
registerContextMenu() call for this ID in the code.
In the toolbar contribution (which is fairly symmetrical to the popup
menu) I have a command that serves as an anchor point for the pull-down
menu. The command has a unique ID, that is also referenced in another
menu contribution, which lists the submenu items. This part works as
expected.
Now, the context menu needs an anchor point too, otherwise how does the
framework know where to put the submenu in?
Anyway, I did the following:
1. added registerContextMenu() for "#BaseMapViewPopup.displayType" in
the code
2. added the new menu contribution to plugin.xml with locationURI
"popup:#BaseMapViewPopup.displayType?after=additions"
3. populated this contribution with a menu item (ID
#BaseMapViewPopup.displayType1)
4. populated this menu item with commands.
<menuContribution
locationURI="popup:#BaseMapViewPopup.displayType?after=additions ">
<menu
icon="icons/elcl16/error_display.gif"
id="#BaseMapViewPopup.displayType1"
label="Options">
<command
commandId="com.kelman.basemap.ui.command.option1"
label="Option 1"
style="radio">
<parameter
name="com.kelman.basemap.ui.command.parameter.option1"
value="OPTION_1">
</parameter>
</command>
... (more similar commands here)
</menu>
</menuContribution>
No submenu shown anywhere. Which makes sense, because there is nothing
to tell the framework how to stick this in the main context menu.
AM
Paul Webster wrote:
> Alex Molochnikov wrote:
>> In my code I added:
>>
>> site.registerContextMenu("#BaseMapViewPopup.displayType", menuManager,
>> null);
>
> The ID you pass into registerContextMenu(*) has to match the locationURI
> of your menuContribution: ex, for that registerContextMenu(*) you would
> be using popup:#BaseMapViewPopup.displayType?after=additions
>
> Then make sure your <menu/> element in that menu contribution has its
> own unique ID (and not #BaseMapViewPopup.displayType again).
>
> PW
>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.12800 seconds