Community
Participate
Working Groups
Steps: 1. Open Ecore diagram 2. Right click on class and select "Remove from Context" The editor is closed. Apparently the menu item operates on the entire diagram.
Yes, this is an annoying common problem with GMF and EMF Tree editors -- nodes typically show all of the commands from their parent file. Often this is hard-wired into the editor itself. For example if you click on a node in an EMF tree editor you get "Validate", etc.. and in this case you also get a file menu. It's difficult to un-contribute items and we're getting the resource remove from context contributed. It could take a lot of exploratory hacking to get rid of it if it is even possible to do so without touching the GMF editor code itself, something we can't do. This is the problem that I was trying to solve by renaming the menu item to Remove from Model.
Renaming the menu item unfortunately doesn't resolve the confusion. It actually makes it worse since it's inconsistent with other structure bridges. We should try to figure this out since Remove from Context actually causes the editor to close. Do you know which bundle contributes the Remove from Context item?
Yes, it's the resource bundle. The first thing I tried was to suppress it by doing : <objectContribution adaptable="true" id="org.eclipse.mylyn.modeling.ecoretools.ui.interest.remove.diagram.element" objectClass="org.eclipse.emf.ecore.EObject"> <action ... overrideActionId="org.eclipse.mylyn.resources.ui.ui.interest.remove.element" tooltip="%InterestDecrementAction.tooltip"> .... </action> But that didn't seem to accomplish anything.
(In reply to comment #3) > Yes, it's the resource bundle. I was afraid that might be the answer. We may need to fix this in the framework. Can you file a bug against context and describe under which circumstances the contribution is problematic and suggest a solution if you have one?
Sure, I'll take a look...I think the issue also lies from the GMF generated editor side, because the generated code for all of that stuff actually hard-codes a lot of the actions/menus rather than using an extensible mechanism, so you can't reach back into the generated editors and change things with changing the actual editor code. IOTW, if resource is contributing a menu item and it's related to the object that the GMF editor is asking for, i.e. in this case the IResource, I'm not sure that mylyn context could be expected to deal with that. But this is all speculation, I'll look more closely at the details.
See bug 358644. Until that get's fixed and into mainstream, I propose we stick with current work-around, which is to shadow with Mylyn for Modeling's own "Remove from Model Context" action. I'll fix the key-bindings as well of course. Make sense?
Sounds good as a temporary work around.
Changing to normal and moving out of initial bug parade.