Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » adding new action to submenu
adding new action to submenu [message #1734555] Thu, 09 June 2016 10:46 Go to next message
Muniraj K A is currently offline Muniraj K AFriend
Messages: 11
Registered: May 2016
Junior Member
I need to add a new command/action to an already existing context menu. Facing problem in uploading the screenshot so I am explaining the problem in words- if we open any project in 'Artop' perspective, we get a package by name 'AUTOSAR' in the list of resources of the project. On right clicking 'AUTOSAR' package(ArPackageImpl object), a context menu with various commands like new child, open in editor, open references etc. is opened.When right clicked on the 'new child' option, there is a submenu opening with the options annotations, ar packages, blueprint policies etc.

The issue now is, I am unable to find the ID of this 'submenu' to add a new command(or action) to it.

using plugin spy, it showed - The active contribution location URI: menu:null?after=additions The active contribution item class: CreateChildAction The contributing plug-in: org.eclipse.emf.edit.ui (2.10.2.v20150123-0452).

Thinking that this submenu does not have an id, I debugged the program to add it programmatically. I found getNewChildDescriptors() method in org.eclipse.sphinx.emf.explorer.actions.providers.BasicModelEditActionProvider class doing the trick(dint understand the logic though). Could anybody please help me achieve this task either by overriding this method or using any extention point.
Re: adding new action to submenu [message #1734576 is a reply to message #1734555] Thu, 09 June 2016 13:37 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31963
Registered: July 2009
Senior Member
I see you posted this on the Sphinx forum too. That would be the best
place to get details specific to Sphix.


On 09.06.2016 12:46, Muniraj K A wrote:
> I need to add a new command/action to an already existing context
> menu. Facing problem in uploading the screenshot so I am explaining
> the problem in words- if we open any project in 'Artop' perspective,
> we get a package by name 'AUTOSAR' in the list of resources of the
> project. On right clicking 'AUTOSAR' package(ArPackageImpl object), a
> context menu with various commands like new child, open in editor,
> open references etc. is opened.When right clicked on the 'new child'
> option, there is a submenu opening with the options annotations, ar
> packages, blueprint policies etc.
>
> The issue now is, I am unable to find the ID of this 'submenu' to add
> a new command(or action) to it.
> using plugin spy, it showed - The active contribution location URI:
> menu:null?after=additions The active contribution item class:
> CreateChildAction The contributing plug-in: org.eclipse.emf.edit.ui
> (2.10.2.v20150123-0452).
>
> Thinking that this submenu does not have an id, I debugged the program
> to add it programmatically. I found getNewChildDescriptors() method in
> org.eclipse.sphinx.emf.explorer.actions.providers.BasicModelEditActionProvider
> class doing the trick(dint understand the logic though). Could anybody
> please help me achieve this task either by overriding this method or
> using any extention point.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[DataBinding] Avoid setting a feature of previously selected element when viewer selection changes
Next Topic:Problem during loading the created model
Goto Forum:
  


Current Time: Thu Aug 05 10:09:33 GMT 2021

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

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

Back to the top