|
|
|
|
|
Re: Converting an Action path into command path [message #479636 is a reply to message #479530] |
Tue, 11 August 2009 19:46 |
Adam Neal Messages: 40 Registered: July 2009 |
Member |
|
|
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:
locationURI="
popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContex tMenu?after=navigateGroup
">
<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?
Thanks again,
Adam
P.S you asked: locationURI="
popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContex
tMenu?after=navigateGroup " to place a command worked, right?
Yes, this works since its an action in the root menu.
"Paul Webster" <pwebster@ca.ibm.com> wrote in message
news:h5rqrg$jg5$1@build.eclipse.org...
> 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
>> infrastructure?
>
>
> 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:
> locationURI="
> popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContex
> tMenu?after=navigateGroup ">
> <menu id="navigateMenu"...> <command ... /> </menu>
>
> It doesn't work? Or does it produce 2 submenus? You said that using
> locationURI="
> popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContex
> tMenu?after=navigateGroup " to place a command worked, right?
>
> PW
>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02385 seconds