Community
Participate
Working Groups
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. :-)
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.
If there are things I can help do for this, please don't be afraid to ask!
Created attachment 239825 [details] Diagram with generics (pre-draft)
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.
Created attachment 239828 [details] TypeParameters, EReferences to them, label computation handling generic types and super types binding.
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.
That is cool!
Thanks :) This has been, so far, easier than I expected thanks to Sirius.
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.