|
|
|
Re: [EEF] Derived Attributes and Enumerators [message #892498 is a reply to message #890670] |
Thu, 28 June 2012 13:11 |
Goulwen Le Fur Messages: 125 Registered: July 2009 |
Senior Member |
|
|
Again :)
You can use SimpleModelNavigation to address your need. In a
PropertiesEditionElement you can create an SimpleModelNavigation that
let you define a reference to navigate before defining the
StructuralFeature in your EditionElement. For instance, if you have a
metamodel with an EClass "Person" having a containing feature typed
"Address" and an Address having an EAttribute "street", you can display
the street of a person in the EEF properties view.
To do that, create an PropertiesEditionElement "street" in the
PropertiesEditionComponent "Person". Create a SimpleModelNavigation in
this PropertiesEditionElement and set the "address" reference to its
"feature" refrence. Back to your street EditionElement, you can choose
the "street" attribute for your model reference. And the generation
takes care of this!
For the moment, the limitation of this system is the need to have the
"Address" in the Person. If there is no address, EEF will throw an
Exception. I'm currently working on a "Smartest" ModelNavigation able to
create element.
Hoping it can help you :)
--
Goulwen
Le 22/06/2012 22:11, Miles Parker a écrit :
> One other thing.. :)
>
> 3. What's the best strategy for easily including in the same editor/view
> containments with cardinality 1-1. IOTW, If I have an EClass that
> contains exactly one other EClass and I want to include the contained
> EClass' attrbiutes in the parent ECLass views as if they were part of
> the same class. I can do this in code, but I'm wondering if there is a
> good way to do this using mostly the model.
|
|
|
Re: [EEF] Derived Attributes and Enumerators [message #893451 is a reply to message #892498] |
Wed, 04 July 2012 08:17 |
aurelien didier Messages: 11 Registered: June 2012 |
Junior Member |
|
|
Hi guys,
Goulwen Le Fur wrote on Thu, 28 June 2012 09:11
You can use SimpleModelNavigation to address your need. In a
PropertiesEditionElement you can create an SimpleModelNavigation that
let you define a reference to navigate before defining the
StructuralFeature in your EditionElement. For instance, if you have a
metamodel with an EClass "Person" having a containing feature typed
"Address" and an Address having an EAttribute "street", you can display
the street of a person in the EEF properties view.
To do that, create an PropertiesEditionElement "street" in the
PropertiesEditionComponent "Person". Create a SimpleModelNavigation in
this PropertiesEditionElement and set the "address" reference to its
"feature" refrence. Back to your street EditionElement, you can choose
the "street" attribute for your model reference. And the generation
takes care of this!
Thanks for the advice.
Goulwen Le Fur wrote on Thu, 28 June 2012 09:11
For the moment, the limitation of this system is the need to have the
"Address" in the Person. If there is no address, EEF will throw an
Exception. I'm currently working on a "Smartest" ModelNavigation able to
create element.
So, until your next release, the best way to create element is to add a CustomModelNavigation and to complete code generation?
Plus, I found myself wondering, in which case do we use ChainedModelNavigation, I haven't find any exemple or discusion about that, so if someone can give me a clear exemple as the example of Goulwen for SimpleModelNavigation, it would be perfect.
Thanks,
Aurélien
|
|
|
Powered by
FUDForum. Page generated in 0.03847 seconds