Bug 357747 - [modeling] Use Mylyn standard "Remove from Context" for model elements rather than "Remove Model Element form Context"
Summary: [modeling] Use Mylyn standard "Remove from Context" for model elements rather...
Status: ASSIGNED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Miles Parker CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 357748 357752 358644
Blocks:
  Show dependency tree
 
Reported: 2011-09-15 05:29 EDT by Steffen Pingel CLA
Modified: 2011-12-06 11:50 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Pingel CLA 2011-09-15 05:29:38 EDT
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.
Comment 1 Miles Parker CLA 2011-09-15 14:00:33 EDT
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.
Comment 2 Steffen Pingel CLA 2011-09-15 15:05:42 EDT
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?
Comment 3 Miles Parker CLA 2011-09-15 15:28:27 EDT
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.
Comment 4 Steffen Pingel CLA 2011-09-15 16:04:27 EDT
(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?
Comment 5 Miles Parker CLA 2011-09-15 16:08:48 EDT
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.
Comment 6 Miles Parker CLA 2011-09-22 14:33:24 EDT
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?
Comment 7 Steffen Pingel CLA 2011-09-22 15:07:46 EDT
Sounds good as a temporary work around.
Comment 8 Miles Parker CLA 2011-09-22 19:31:42 EDT
Changing to normal and moving out of initial bug parade.