Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Popup menu problem
Popup menu problem [message #155881] Wed, 27 October 2004 14:12 Go to next message
Paul E. Keyser is currently offline Paul E. KeyserFriend
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="&amp;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 Go to previous message
Eclipse UserFriend
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="&amp;Split..."
> class="refactor.actions.diagram.EditorSplitter"
> menubarPath="additions"
> enablesFor="1"
> id="refactor.diagramSplitAction">
> </action>
> </viewerContribution>
>
> thanks,
> Paul
Previous Topic:Create a block arrow
Next Topic:Problem with DelegatingLayout
Goto Forum:
  


Current Time: Sat Apr 27 04:39:33 GMT 2024

Powered by FUDForum. Page generated in 0.03262 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top