Bug 212409 - Add EMF Generics support
Summary: Add EMF Generics support
Status: RESOLVED FIXED
Alias: None
Product: Ecoretools
Classification: Modeling
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 normal
Target Milestone: 2.0.0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: Compatibility
Keywords: plan
Depends on:
Blocks:
 
Reported: 2007-12-10 09:40 EST by Jacques LESCOT CLA
Modified: 2014-06-04 08:38 EDT (History)
8 users (show)

See Also:


Attachments
Diagram with generics (pre-draft) (12.57 KB, image/png)
2014-02-11 08:47 EST, Cedric Brun CLA
no flags Details
TypeParameters, EReferences to them, label computation handling generic types and super types binding. (14.81 KB, image/png)
2014-02-11 09:40 EST, Cedric Brun CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jacques LESCOT CLA 2007-12-10 09:40:27 EST
The Ecore graphical editor should support Generics. In a first time we should at least use notation defined through Label providers defined at the EMF level, then we should think of a more graphical way to show them (see how this is achieved in UML2 Tools for the Template notation).
We also expect that Ed will have plenty of good ideas on this subject, and that he could give us the point of view of the modeling community. :-)
Comment 1 Ed Merks CLA 2007-12-10 16:51:14 EST
Thanks.  I'm definitely interested in this.  I have three weeks for vacation starting next week and playing with the graphical editor and looking for ways to contribute are at the top of my list of thing to look in with my personal time.
Comment 2 Ed Merks CLA 2008-09-28 07:40:02 EDT
If there are things I can help do for this, please don't be afraid to ask!
Comment 3 Cedric Brun CLA 2014-02-11 08:47:43 EST
Created attachment 239825 [details]
Diagram with generics (pre-draft)
Comment 4 Cedric Brun CLA 2014-02-11 08:50:07 EST
I'm giving it a shot. 
I'm attaching a screenshot of the current status.

Now one can create type parameters (represented as border nodes) and the direct edit and rendering of labels has been updated accordingly. Typing " myAttribute : T" will create the generic type instance and set the TypeParameter just as expected.

Now there is much more things to cover which are not quite clear to me from an usability perspective.

Let's say ExplicitSelection have an EReference "selectionRef" which returns "T". Should I display the edge between ExplicitSelection to its own port ? Or between ExplicitSelection and the EObject type (I will probably try with an edge going to the "T" port and see how it goes)

What about "T extends X" case, then the label within the port notation will not work that well :/

I also still need to figure out how the end user is supposed to bind to generic types. Wizards ? Dedicated edges ? Customized superType edge ? Through the property views ?

At last but no least, we will need specific toolings (selection wizards ? ) to bound the Type Parameters.
Comment 5 Cedric Brun CLA 2014-02-11 09:40:43 EST
Created attachment 239828 [details]
TypeParameters, EReferences to them, label computation handling generic types and super types binding.
Comment 6 Cedric Brun CLA 2014-02-11 11:20:35 EST
The next nightly build will be pretty much usable already. Notable missing pieces  : 

1 - direct edit on the superType label. Right now the user has to go into the "semantic" tab of the property view to value the binding.
2 - one can specify limit/bound types using the property view but nothing will change in the diagram.
Comment 7 Eike Stepper CLA 2014-02-11 11:29:36 EST
That is cool!
Comment 8 Cedric Brun CLA 2014-02-11 12:24:27 EST
Thanks :) This has been, so far, easier than I expected thanks to Sirius.
Comment 9 Cedric Brun CLA 2014-06-04 08:38:27 EDT
The basic support is here, we could streamline the direct edit operations for the binding but that would have to wait for the next release. In the meantime users can use the "Semantic" tab in the properties view to fill the bindings.