Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Nodes with inital names
Nodes with inital names [message #1062437] Fri, 07 June 2013 12:59 Go to next message
Phil H is currently offline Phil H
Messages: 267
Registered: November 2012
Senior Member
Hi,

I'm using Eugenia to create my GMF Editor. For this reason I've defined an emf model where atributes have inital names. See an example here:

class Feature{
  	attr EString name = "Feature_Name";


At the first look, everything seems to work when I add a Feature node to my diagram:

index.php/fa/15195/0/

But when I've a look at the corresponding xmi file, the Feature nodes name attribute is empty:

<features xmi:type="p:Feature" xmi:id="_Bn0_8M-TEeK3OJuP1YZyXg"/>


But after changing manually the name of the Feature node, it's working:

<features xmi:type="p:Feature" xmi:id="_Bn0_8M-TEeK3OJuP1YZyXg" name="Feature Name"/>


Any ideas how I can solve this, so that all nodes initially have a name?

Cheers,
Phil
  • Attachment: Feature.JPG
    (Size: 8.86KB, Downloaded 87 times)
Re: Nodes with inital names [message #1062442 is a reply to message #1062437] Fri, 07 June 2013 13:54 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 700
Registered: July 2009
Senior Member
Hi Phil,

EMF does not serialise the values of slots that are equal to the default value of their corresponding attribute. If you really need a value to appear in the XMI you should omit = "Feature Name" from your Emfatic definition and modify the doExecuteWithResult generated method as discussed in [1] to assign a default value there.

Cheers,
Dimitris

[1] http://www.eclipse.org/forums/index.php/mv/msg/486121/1056056/#msg_1056056
Re: Nodes with inital names [message #1062591 is a reply to message #1062442] Sun, 09 June 2013 11:22 Go to previous messageGo to next message
Phil H is currently offline Phil H
Messages: 267
Registered: November 2012
Senior Member
Thx Dimitris,

what about setting the attribute as unsettable as discussed here (http://www.eclipsezone.com/eclipse/forums/t112254.html) or here (http://www.eclipsezone.com/eclipse/forums/t58262.html) ?

I tried out this, but I doesn't worked, which surprise me:

class FeatureModel{
  	unsettable attr EString name = "FeatureModel";
Re: Nodes with inital names [message #1062607 is a reply to message #1062591] Sun, 09 June 2013 18:52 Go to previous message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 700
Registered: July 2009
Senior Member
Hi Phil,

I haven't needed to do this so far so I'm afraid I can't help much here. I suspect you'd have a better chance in the EMF forum with this one.

Cheers,
Dimitris
Previous Topic:HELP! java.lang.NullPointerException when editing .model
Next Topic:[EuGENia] Problem customizing the GMF editor
Goto Forum:
  


Current Time: Fri Apr 18 17:02:13 EDT 2014

Powered by FUDForum. Page generated in 0.01568 seconds