I want to add an action to the "Source" menus in Eclipse (there's one in the main menu, one when you press alt+shift+S in the Editor, one when you right click the editor and select source).
The code closest to working is this one (it's only shown in the submenu of the popup, not in the other two):
<extension point="org.eclipse.ui.menus">
<menuContribution allPopups="true"
locationURI="popup:org.eclipse.jdt.ui.source.menu?after=additions">
<command commandId="org.acme.command" style="push" />
</menuContribution>
</extension>
The Eclipse Menu Spy claims the URL of the actions is something like that: ''locationURI="menu:null?after=AddGetterSetter"'', but of course this does not work either.
Someone was suggesting it might be due to the use of action sets, but this answer is four years old, and even though there are still actions used in the JDT plug-ins, they must have evolved since then (they are even deprecated).
Nonetheless, I tried the approach there, something like:
<extension point="org.eclipse.ui.actionSets">
<actionSet label="Java Coding" visible="true" id="org.eclipse.jdt.ui.CodingActionSet2">
<menu label="&Source" path="edit" id="org.eclipse.jdt.ui.source.menu">
</menu>
<action class="org.acme.Action"
id="org.acme.action"
label="Hello World"
menubarPath="org.eclipse.jdt.ui.source.menu/generateGroup">
</action>
</actionSet>
</extension>
It did not work. So how do you add actions to the "Source" menu in the current Eclipse version?