Popup menu problem [message #155881] |
Wed, 27 October 2004 14:12 |
Paul E. Keyser Messages: 878 Registered: July 2009 |
Senior Member |
|
|
We have a set of popup-menus created in two ways: (1) in java, via the action-registry, i.e., not
plugin.xml; (2) via plugin.xml, using objectContribution, i.e., not via the action-registry. Both
sets of popup-menu items work fine.
Now we want to add other items via the plugin.xml, using viewerContribution -- that fails. The
item(s) appear in the popup-menu, but are *never* enabled, and in fact no code in their class(es) is
ever called. What mistake are we making? Or does GEF not play with viewerContribution?
Here is the XML; the class="refactor.actions.diagram.EditorSplitter" does exist, and the
targetID="editors.modifiers.diagram.diagramcontextmenu" is registered, using
IWorkbenchPartSite.registerContextMenu():
<viewerContribution
targetID="editors.modifiers.diagram.diagramcontextmenu"
id="refactor.diagramViewer">
<action
label="&Split..."
class="refactor.actions.diagram.EditorSplitter"
menubarPath="additions"
enablesFor="1"
id="refactor.diagramSplitAction">
</action>
</viewerContribution>
thanks,
Paul
|
|
|
Re: Popup menu problem [message #155889 is a reply to message #155881] |
Wed, 27 October 2004 14:51 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
I think that a contextmenu in GEF is nothing more than a JFace MenuManager,
which is attached to an EditPartViewer's Control.
You should try debugging ActionContributionItem/MenuManager to see what is
really behind that MenuItem, and why it is disabled.
"Paul Keyser" <rolarenfan@earthlink.net> wrote in message
news:cloa1u$7fb$1@eclipse.org...
> We have a set of popup-menus created in two ways: (1) in java, via the
action-registry, i.e., not
> plugin.xml; (2) via plugin.xml, using objectContribution, i.e., not via
the action-registry. Both
> sets of popup-menu items work fine.
>
> Now we want to add other items via the plugin.xml, using
viewerContribution -- that fails. The
> item(s) appear in the popup-menu, but are *never* enabled, and in fact no
code in their class(es) is
> ever called. What mistake are we making? Or does GEF not play with
viewerContribution?
>
> Here is the XML; the class="refactor.actions.diagram.EditorSplitter" does
exist, and the
> targetID="editors.modifiers.diagram.diagramcontextmenu" is registered,
using
> IWorkbenchPartSite.registerContextMenu():
>
> <viewerContribution
> targetID="editors.modifiers.diagram.diagramcontextmenu"
> id="refactor.diagramViewer">
> <action
> label="&Split..."
> class="refactor.actions.diagram.EditorSplitter"
> menubarPath="additions"
> enablesFor="1"
> id="refactor.diagramSplitAction">
> </action>
> </viewerContribution>
>
> thanks,
> Paul
|
|
|
Powered by
FUDForum. Page generated in 0.05019 seconds