|Re: Converting an Action path into command path [message #479636 is a reply to message #479530]
||Tue, 11 August 2009 19:46
| Adam Neal
Registered: July 2009
It seems that the GMF navigate menu is being created first, before the |
PopupMenuExtender gets its chance to add contributions. Therefore the
navigateMenu already exists by the time I try to add to it (as I have other
actions which have already been added to it).
I am again trying to re-create the Navigate menu via:
<menu id="navigateMenu"...> <command ... /> </menu>
If I change the id to be navigateMenu1,then I get two menus showing up. But
if I use the GMF id, my command seems to get wiped out.
Here's what I found by debugging.
In the WorkbenchMenuService::processAdditions, the idx value is found to 9
(index when using the cache...). The safe runnable is then used to add my
menu item...The expressions return true for visiblity. It gets the
ManagerPopulationRecord from the ContributionManager, and from this I can
see the menu URI is popup:navigateMenu. Eventually we find ourselves at line
599 in the SafeRunnable of the WorkbenchMenuService::processAdditions trying
to insert the command: mgr.insert(insertionIndex, ici);
At this point, the mgr has an empty contributions list!?! So this method
throws an ArrayIndexOutOfBoundsException since its asking to add at index 9
and therefore I never get added to the menu.
Does this ring a bell for you as to what might be wrong?
P.S you asked: locationURI="
tMenu?after=navigateGroup " to place a command worked, right?
Yes, this works since its an action in the root menu.
"Paul Webster" <firstname.lastname@example.org> wrote in message
> Adam Neal wrote on Mon, 10 August 2009 14:43
>> Looks like its contributed through GMF's DiagramContributionItemProvider
>> as a popupmenu
>> <popupmenu path="/navigateGroup" id="navigateMenu"/>
>> Does this mean that its not accessible via the org.eclipse.ui.menus
> I'm not familiar with how GMF is creating its submenu, but it might not be
> available to o.e.ui.menus.
> When you try and add the submenu using:
> tMenu?after=navigateGroup ">
> <menu id="navigateMenu"...> <command ... /> </menu>
> It doesn't work? Or does it produce 2 submenus? You said that using
> tMenu?after=navigateGroup " to place a command worked, right?
Powered by FUDForum
. Page generated in 0.03936 seconds