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, 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. I have wasted much time in determining which artop plugin has contributed this submenu. How to find it? do anybody know this submenu's id. please help me. thank you..
Asked
Active
Viewed 155 times
1 Answers
0
If you have 'plug-in spy' installed you can press Alt+Shift+F2 before opening the menu and it will show you information about the menu item when you click the item (instead of running the item action).
However note that depending on how the menu is created it may not have an id.

greg-449
- 109,219
- 232
- 102
- 145
-
ya I have tried many times with spy, it shows 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) – Raj Jun 06 '16 at 07:24
-
menu:null means it does not have a menu id? – Raj Jun 06 '16 at 07:25
-
Yes I think that means there is no id, many submenus don't have ids. – greg-449 Jun 06 '16 at 07:35
-
ohhh.. then how will I add a new command to it..any solution? – Raj Jun 06 '16 at 08:32
-
friends is there any possibility to add a new command to a submenu without id? I mean, any chance of achieving it by matching the 'visibleWhen' or 'enabledWhen' attributes of command's menu contribution and handler respectively. – Raj Jun 07 '16 at 07:20