So in the end, the only solution that worked is unfortunately a hack. I went with overriding extractSubmenuActions()
in my BasicModelEditActionProvider
, changing it to give me the submenus I wanted. The ugly part is finding the EMF object to-be-added, for which I unfortunately used reflection to forcefully read the protected command
field of the normally abstracted IAction
.
This forcefully breaks the encapsulation but due to external constraints on my code, I was unable to modify the item providers of the model. The reflective solution is not pretty, but works perfectly.