Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 357766

Summary: [modeling] EAttribute, EOperation and EPackage elements are not tracked
Product: z_Archived Reporter: Steffen Pingel <steffen.pingel>
Component: MylynAssignee: Miles Parker <milesparker>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: b.muskalla
Version: unspecified   
Target Milestone: 0.9   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 357895    
Bug Blocks: 354787    
Attachments:
Description Flags
My Projec Explorer view.
none
unfocused
none
focused none

Description Steffen Pingel CLA 2011-09-15 06:28:34 EDT
Steps:
1. Select an Ecore attribute, operation or package in Package Explorer

No interaction event is recorded and the elements always appear filtered when the view is focused.
Comment 1 Miles Parker CLA 2011-09-15 15:01:13 EDT
This is because Ecore Editor only supports the Project Explorer. :) bug 352043

BTW, since we are made a decision not to support attributes or operations in the diagram editors. We could add this back in as a feature enhancement. To summarize that discussion, my thought was that attributes should not be included because they are more or less equivalent to Java fields, i.e. too granular. But that was based on the mistaken observation that Java fields are not managed by contexts, when in fact they are. :)
Comment 2 Steffen Pingel CLA 2011-09-15 15:30:43 EDT
Sorry, I meant the Project Explorer not the Package Explorer.

The attributes and operations are structural elements that are represented with unique identifiers the model. Any reason not to track them in the EMF bridge?
Comment 3 Miles Parker CLA 2011-09-15 15:38:06 EDT
Created attachment 203445 [details]
My Projec Explorer view.
Comment 4 Miles Parker CLA 2011-09-15 15:39:58 EDT
(In reply to comment #2)
> Sorry, I meant the Project Explorer not the Package Explorer.

OK, hmm, I'm not seeing that, is my attachment inconsistent with what you're seeing?

> 
> The attributes and operations are structural elements that are represented with
> unique identifiers the model. Any reason not to track them in the EMF bridge?

No, I think they should be tracked, and I thought they were being tracked. We weren't planning to originally, and I'm not sure if they should be in the diagram or not -- they probably should be but I'm not sure how much work that will be.

reopening..
Comment 5 Miles Parker CLA 2011-09-15 21:10:55 EDT
Steffen and Benny, please also see bug 357895. I'd like your opinions on the quality of that approach.
Comment 6 Steffen Pingel CLA 2011-09-16 05:11:57 EDT
References work fine. Try adding an operation or attribute that has EBoolean as it's type. 

Subpackages seem to be special. If I remove them from the model all elements that are part of the model disappear from the context. Do they map to the same handle as the Ecore file?
Comment 7 Steffen Pingel CLA 2011-09-16 05:13:17 EDT
Created attachment 203475 [details]
unfocused
Comment 8 Steffen Pingel CLA 2011-09-16 05:13:41 EDT
Created attachment 203476 [details]
focused
Comment 9 Steffen Pingel CLA 2011-09-16 05:14:19 EDT
I had selected op() and would expect this element to be part of the context.
Comment 10 Miles Parker CLA 2011-09-16 13:43:25 EDT
Let me know if the changes I've just pushed take care of the ops issue. Looks good on my end.
Comment 11 Miles Parker CLA 2011-09-16 13:47:42 EDT
(In reply to comment #6)
> References work fine. Try adding an operation or attribute that has EBoolean as
> it's type.

References are actually another funny case. References coorespond to edges in the diagram. They aren't managed on the diagram side as we only want to show references between focussed nodes. People aren't going to want to be clicking around on references to reveal them. But wee have to track them on the tree editor side. Not sure what if any the ideal solution is to that, but let's leave it be for now.

> 
> Subpackages seem to be special. If I remove them from the model all elements
> that are part of the model disappear from the context. Do they map to the same
> handle as the Ecore file?

No, only the root most package does. If you remove a sub-package it should only delete the model elements that are part of that sub-package.
Comment 12 Steffen Pingel CLA 2011-09-16 16:56:05 EDT
Thanks for implementing this. It appears to work great!

(In reply to comment #11)
> > References work fine. Try adding an operation or attribute that has EBoolean
> as
> > it's type.
> 
> References are actually another funny case. References coorespond to edges in
> the diagram. They aren't managed on the diagram side as we only want to show
> references between focussed nodes. People aren't going to want to be clicking
> around on references to reveal them. But wee have to track them on the tree
> editor side. Not sure what if any the ideal solution is to that, but let's leave
> it be for now.

I'm not concerned about the diagram editor. The EMF bridge should support tracking the model elements regardless of the visualization.

> > Subpackages seem to be special. If I remove them from the model all elements
> > that are part of the model disappear from the context. Do they map to the same
> > handle as the Ecore file?
> 
> No, only the root most package does. If you remove a sub-package it should only
> delete the model elements that are part of that sub-package.

When I remove a sub-package it removes the entire root package of the model  from the context. I just tried with the latest and saw the same thing. Trying with a new project I now get an NPE. I have filed bug 357993 to track that.
Comment 13 Miles Parker CLA 2011-09-26 16:32:18 EDT
For all elements above.