|
Re: Using GMF and dynamic EMF with EEnumLiteral [message #536492 is a reply to message #536480] |
Fri, 28 May 2010 13:06 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Ed Merks![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=ed.merks%40gmail.com) Messages: 33205 Registered: July 2009 |
Senior Member |
|
|
Georges,
Comments below.
Georges wrote:
> Hello everyone !
>
> I would like to add more flexibility to my Ecore model by using
> dynamic EMF capability. One of my Ecore classes is called Decision and
> has a decisionType attribute of type DecisionType which is an EEnum
> with no literals.
>
> I add literals to the EEnum by program when my GMF-based graphical
> editor starts up.
A generated model should not be dynamically modified. This just isn't
supported. Are you really saying you have a generated empty Java
enumeration?
> When I select a Decision instance graphical object in the editor, a
> combo-box in the Properties view lets me select a value for the
> decisionType attribute; but instead of getting foo, bar, ding as
> combo-box displayed values, I get foo=0, bar=1 and ding=2. This would
> be acceptable, although not very nice, but the main issue is that
> whatever the selected value is, the decisionType property is never
> set. Could you please tell me what I am missing ?
>
> Thanks a lot in advance for your time !
>
> Georges
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Re: Using GMF and dynamic EMF with EEnumLiteral [message #536568 is a reply to message #536515] |
Fri, 28 May 2010 16:31 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Ed Merks![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=ed.merks%40gmail.com) Messages: 33205 Registered: July 2009 |
Senior Member |
|
|
Georges,
Comments below.
Georges wrote:
> Hello Ed,
>
> Yes, my generated Java enumeration was initially empty. I have
> slightly modified it by adding a default "None" literal which value is 0.
> After getting your reply, I have read again the Dynamic EMF chapter of
> the EMF book and found this : "Even when using dynamic EMF, once we
> begin instantiating the model, it is no longer safe to change it."
> Should I create a dynamic class or enum that extends a generated one
Enums aren't extensible.
> , and add additional features there, like suggested in the book ?
A dynamic package with an extending class with a feature of some dynamic
enum also from that package would make sense.
>
> Best regards,
>
> Georges
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
Re: Using GMF and dynamic EMF with EEnumLiteral [message #537019 is a reply to message #536934] |
Mon, 31 May 2010 23:23 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Ed Merks![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=ed.merks%40gmail.com) Messages: 33205 Registered: July 2009 |
Senior Member |
|
|
Georges,
GMF's Tooling is heavily focused on generating what's needed. I'm not
even sure it works with dynamic models. E.g., I don't think there is a
GMF reflective editor. Someone more familiar will need to comment.
Georges wrote:
> Hello Ed,
>
> I am still trying to implement dynamically a part of my EMF model so
> that I can set dynamic attributes values through combo-boxes in the
> Properties view of my graphical editor.
>
> I dynamically extend the Decision class with a DynamicDecision one and
> I add a decisionType attribute to the derived class. The type of the
> decisionType attribute is DecisionType which is a dynamic EEnum.
>
> If Decision had no attribute, I couldn't map anything from GMF to
> Decision. So, I suppose I should add an attribute to the Decision
> class. Am I wrong ? If an attribute is necessary, what type should
> this attribute be set to since we do not know the type of the
> attribute which will be dynamically added to the derived class ?
>
> Could you (or someone else, since this is mainly a GMF-related
> question) clarify the Dynamic-EMF / GMF relationship, please ?
>
> Thanks a lot in advance for your time !
>
> Georges
>
>
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.05042 seconds