how to create a figure without a corresponding model element [message #551497] |
Fri, 06 August 2010 12:25  |
Eclipse User |
|
|
|
I know this is a very tricky question and I do not expect someone in this forum to do this work for me, I'm just interested in any pointers on any information related on the subject.
I need to create graphic elements depending on semantic information in elements in the model. Furthermore, this new created elements should be able to host (be parents) for model elements.
Let's say I have objects of type T that have an attribute "block", like:
<t name="t_B1" block="B">
....
</t>
<t name="t_B2" block="B">
....
</t>
<t name="t_A1" block="A">
....
</t>
I don't have elements of type "block", just "block" attributes.
What I would like to do, is to create a graphical representation of a block, like a rectangle which hosts (is parent) for t_B1 and t_B2 elements.
This would be straight forward if my model was like:
<block name="B">
<t name="t_B1">
....
</t>
<t name="t_B2">
....
</t>
</block>
<block name="A">
<t name="t_A1" block="A">
....
</t>
</block>
But I have to create an editor for an already existing model, so I don't have the "block" element, I need to "simulate" it, and don't have the right to add it in the xml file.
Any advice of any kind, would be appreciated (even one that says "forget that, it's not possible with gmf" would spare me a lot of time of research and debugging).
Cheers,
Emil.
|
|
|
Re: how to create a figure without a corresponding model element [message #551790 is a reply to message #551497] |
Mon, 09 August 2010 10:50  |
Eclipse User |
|
|
|
One solution I found for the problem:
Introduce, in the EMF model, a TRANSIENT element (in my case, corresponding to "block"). Actually, the element is not transient itself, but only attached to the model tree through a transient relationship.
In this way we can have a model element (therfore an edit part) which is not serialized in the xml file.
|
|
|
Powered by
FUDForum. Page generated in 0.02718 seconds