Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » define element's name(define element's name)
icon7.gif  define element's name [message #1759487] Wed, 12 April 2017 08:57 Go to next message
sarah sh is currently offline sarah shFriend
Messages: 32
Registered: March 2017
Member
Good morning,

I want to set the name of an element depending on the name of each container. So each time I modify the container's name, the element's name will change immediately.

When I set an element's name at the moment of creation, it's just a String: there is no relations

Thank you for answering
Re: define element's name [message #1759494 is a reply to message #1759487] Wed, 12 April 2017 09:49 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
Hello,

It depends if you want the name of the element this way, as a graphical information or a semantic information. What I mean is if you want the name of the element (based on the name of the container) just as an information that is displayed, or if you want it saved in a name field of the semantic element.

If you just want it as a displayed information in a particular representation, you just need to set the expression in the label field of your style's mapping to be a construction of container-name+element-name. You creation tool would just set the element-name.

If you want a field in your element that returns a name that is a constrution of container-name+element-name, I think that the simplest way is to add an a derived reference, let's name it "fullname" that computes and returns a String container-name+element-name. You creation tool would just set the element-name. In your mapping's style, you would use "fullname" as the displayed label.

In both way, this will update the label automatically on drag and drop.

Regards,
Steve


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: define element's name [message #1759575 is a reply to message #1759494] Thu, 13 April 2017 12:05 Go to previous messageGo to next message
sarah sh is currently offline sarah shFriend
Messages: 32
Registered: March 2017
Member
Hello,

Thank you for your answer but I'm not talking about the name of the label.
I'm talking about an attribute of type string it can be firstName, Title...
Thank you again
Re: define element's name [message #1759585 is a reply to message #1759575] Thu, 13 April 2017 13:14 Go to previous message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
Hello,

Ok so it's the second solution if you want it computed or same process as described in https://www.eclipse.org/forums/index.php/t/1085568/ but instead of reacting on name change, you react on containement change.

Regards,
Steve


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Validation troubles
Next Topic:event listener
Goto Forum:
  


Current Time: Thu Apr 25 10:26:14 GMT 2024

Powered by FUDForum. Page generated in 0.03336 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top