Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Node with more than one label(So editing more features of an element)
Node with more than one label [message #1787071] Fri, 18 May 2018 11:29 Go to next message
Andreas Buchner is currently offline Andreas BuchnerFriend
Messages: 43
Registered: August 2017
Member
index.php/fa/32850/0/

Hi,

from the Tutorial it is know, that you can edit an Feature (like name) of an element (like man) via the Label Edit Tool.

Therefor it could be beneficial to me, if I had a Node with multiple labels, that I can edit independently.

For Example:
The label of the ManNode shows the name. I can edit the label, and the name of the man changes. If you had a second label that shows the age of the man, I could change 2 features of one element, without the propertyView, what so ever.

index.php/fa/32851/0/

Is that possible? Or is there an equal way already?
Re: Node with more than one label [message #1787079 is a reply to message #1787071] Fri, 18 May 2018 14:29 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 388
Registered: May 2011
Senior Member
Hello,

I think you have several way to do it:
- With a label edit tool, you can edit several properties at once depending how you defined the masks (by default there is only {0} to edit one field);
- You can define a double click tool containing an "Open Dialog" operation where you can edit each field you define in one view;
- Provide a custom style [1] with an EditPart having several LabelEditPart....but I think it is far more complicated and overkill for this.

Regards,
Steve

[1] https://www.eclipse.org/sirius/doc/developer/extensions-provide_custom_style.html


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Node with more than one label [message #1787210 is a reply to message #1787079] Tue, 22 May 2018 07:28 Go to previous messageGo to next message
Andreas Buchner is currently offline Andreas BuchnerFriend
Messages: 43
Registered: August 2017
Member
Hi Steve,
thanks a lot for your answer.
I have not defined a mask before, so I would like to ask one or two things about it.

When the Label says "Peter, 25" the value of {0} is by Default "Peter, 25".
So is it possible to define a Var {1}, which value will be everything before the comma: "Peter"
and a Var {2}, wgich will be everything after the comma: "25"?

So I can declare my "Set" Operation like this:

Feature Name: name
Valuze Expression:var:1
______________________

Feature Name: age
Value Expression:var:2

Is there a tutorial?

Thanks a lot for your help!!!



Re: Node with more than one label [message #1787291 is a reply to message #1787210] Wed, 23 May 2018 08:49 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 388
Registered: May 2011
Senior Member
Hello Andreas,

If you display your labels as the example "Peter,25" then in your direct edit tool, you need to edit the Mask Variables from '{0}' to '{0},{1}'. This way the ',' identifies where we split between two arguments. Then in your tool, you can have a first "Set" operation where the feature ame field will be name and the value expression field will be var:arg0 (as usual then). Finally, you will add a second "Set" operation with a feature name as "age" and a value expression as "var:arg1".

I don't think that we have a tutorial about it, but as you can see it is pretty easy to use.

Regards,
Steve


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Node with more than one label [message #1787376 is a reply to message #1787291] Thu, 24 May 2018 09:09 Go to previous message
Andreas Buchner is currently offline Andreas BuchnerFriend
Messages: 43
Registered: August 2017
Member
Cool, thanks a lot :)
Previous Topic:Node position on creation
Next Topic:Customization of sirius editor tab bar and palette toolbar
Goto Forum:
  


Current Time: Thu Nov 15 01:38:39 GMT 2018

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

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

Back to the top