Community
Participate
Working Groups
Hi all, I'm trying to create an action where the handler is active when the selected elements can be adapted to EObject. I can't do it in a Diagram and I think there is a bug... I use the example Ecore Diagram to test it and the plugin attached to this bug. Steps to reproduce : 1/ create a new Ecore Diagram 2/ Create 2 EClass in this Diagram 3/ Select them 4/ right Click, my plugin should provide an action called "Handler Test" in this menu, but it doesn't work properly. my code : <extension point="org.eclipse.ui.menus"> <menuContribution allPopups="true" locationURI="popup:org.eclipse.ui.popup.any"> <command commandId="testHandlerActivation" label="Handler Test" style="push"> <visibleWhen checkEnabled="false"> <with variable="selection"> <iterate> <adapt type="org.eclipse.emf.ecore.EObject"> </adapt> </iterate> </with> </visibleWhen> </command> </menuContribution> </extension>
Created attachment 219051 [details] This plugin provides an handler to test the handler activation on a selection adapted to EObject
GEF is neutral w.r.t. to the implementation technology of its model. Thus, EditParts should not be adaptable to EObjects by default. You may achieve your desired behavior by overwriting the getAdapter() method within your custom EditParts respectively. I am resolving this as wont fix thus.