Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » TreeViewer context menu does not show up
TreeViewer context menu does not show up [message #921737] Mon, 24 September 2012 07:38 Go to next message
Christian Eugster is currently offline Christian Eugster
Messages: 134
Registered: July 2009
Location: St. Gallen Switzerland
Senior Member
Hi,

I have some problems using a context menu in a treeViewer. I follow the readings of Vogella, added two commands, the respective handlers, and a MPopupMenu with the respective Handled MenuItems to the part containing the treeViewer in the Application.d4xmi.

In the coded part I injected the EMenuService and added the code as explained by Vogella:

menuService.registerContextMenu(viewer, "popupmenu");

where "popupmenu" is the id of MPopupMenu in the model.

Am I missing something?

Thanks!
Re: TreeViewer context menu does not show up [message #921832 is a reply to message #921737] Mon, 24 September 2012 09:22 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph Keimel
Messages: 297
Registered: December 2010
Location: Germany
Senior Member
Hi Christian,

Three questions:
a) Is your MPopupMenu in the model after startup?
b) As child of the part where your viewer is located?
c) With the correct id ("popupmenu")?

You can check by using the Live-Model-Editor to check it during runtime.

1) You need to add some bundles to your product:
- org.eclipse.e4.tools.emf.liveeditor
- org.eclipse.e4.tools.emf.ui
- org.eclipse.e4.tools.emf.ui.script.js
and the required plug-ins
2) After you start the product like this, press Alt-Shift-F9

Hope this helps!
Christoph
Re: TreeViewer context menu does not show up [message #922099 is a reply to message #921832] Mon, 24 September 2012 14:36 Go to previous message
Christian Eugster is currently offline Christian Eugster
Messages: 134
Registered: July 2009
Location: St. Gallen Switzerland
Senior Member
Hi Christoph,

thank you for resolving this. My real id was much longer and had indeed a typo.

Christian
Previous Topic:How to hook the "About" menu on Mac
Next Topic:Callback for EventLoopException
Goto Forum:
  


Current Time: Sat Apr 19 21:45:29 EDT 2014

Powered by FUDForum. Page generated in 0.29819 seconds