Generating Elements Automatically [message #500834] |
Sun, 29 November 2009 07:46  |
Eclipse User |
|
|
|
Hi everyone, im new to GMF. I have got the following problem. I created an Editor, which allows me to generate a node on the canvas. Always when I create a node, i wanted to create a child element automatically (but it should not be drawn on the canvas). I managed this via the mapping file by adding "Feature Seq Initializer", "Reference New Element Spec", another "Feature Seq Initializer", a "Feature Value Spec" and a "Value Expression". That worked so far, the XML-File generated by the Editor contains the element. But, I wasn`t able to set an attribute value of the element. I thought this works with the Body of the "Value Expression", but I wasn`t able to manage it.
So my questions are, is the mentioned way the right way to create elements automatically and how can I set Attribute-Values of the Elements automatically.
Somebody help please.
|
|
|
|
Re: Generating Elements Automatically [message #500842 is a reply to message #500840] |
Sun, 29 November 2009 08:51  |
Eclipse User |
|
|
|
Thank you for the reply. The element wich should be added to my domain model has got one attribute "name:String". In the value expression I used java as language and tried the following expressions for the "body"-part: name="test", this.name="test", "test", new String("test") ... but nothing worked. Could you give me an example of how to set the value or a link to a documentation site? It would also help me to know, where I can find the relevant parts of the generated diagram code, because until now I only used the GMF tree-editor.
|
|
|
Powered by
FUDForum. Page generated in 0.03587 seconds