Hi,
I am not sure if this is the right forum but let's try.
I have implemented some functionality that is executed from top menu bar. These actions are triggered by handlers. For example, this is the way I have defined the actions in plugin.xml and they are working nicely:
<extension
point="org.eclipse.ui.handlers">
<handler
commandId="org.eclipse.papyrus.myCommands.myCommand"
class="org.eclipse.papyrus.myHandlers.myHandler">
</handler>
</extension>
I'd like to execute the same functionality from context popup menu, so I created an entry like this:
<extension point="org.eclipse.ui.popupMenus">
<objectContribution
adaptable="false"
id="org.eclipse.papyrus.mymenus.mypopupmenu"
objectClass="org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeEditPart">
<menu
id="mypopup"
label="&My Menu"
path="additions">
<separator name="group1"/>
</menu>
<action
class="org.eclipse.papyrus.ossli.myActions.myAction"
definitionId="org.eclipse.papyrus.myCommands.myCommand"
enablesFor="1"
id="org.eclipse.papyrus.ossli.menus.myPopupaction"
label="&My Action"
menubarPath="mypopup/group1">
</action>
</objectContribution>
</extension>
This works fine and the runWithEvent-method from myAction is executed. myAction implements IActionDelegate2.
1. Is there a way to execute a handler straight from popupMenu extension point?
2. If not. How can I generate an ExecutionEvent needed by the myHandler's (implements AbstactHandler) execute-method as a parameter?
I am using Papyrus if it matters.
[Updated on: Tue, 11 October 2011 11:20] by Moderator