Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Candidates Expression for Select or Radio based on ecore Enumeration(Properties View)
Candidates Expression for Select or Radio based on ecore Enumeration [message #1745804] Mon, 17 October 2016 15:35 Go to next message
Joerg Hermann is currently offline Joerg HermannFriend
Messages: 15
Registered: September 2012
Location: Munich
Junior Member
Thanks for providing the new properties view. I think, this is really great.
I'm just struggling with displaying enumerated properties from my ecore model
(sth like a property 'color', which could be one of 'RED', 'BLUE', GREEN').
I saw that the default implementation, if I do not specify anything in the VSM
is showing the options provided in the model as radio buttons.
Unfortunately, I was not able to create a correct content for the 'Candidates Expressions' field, which I think should provide a list of the available enum
literals.
I know, I can obtain these as a list from the EPackage, but how can I access this
here?
Or might there possibly be a more elegant solution?

Any help is very much appreciated Smile

best regards,
Joerg
Re: Candidates Expression for Select or Radio based on ecore Enumeration [message #1745829 is a reply to message #1745804] Tue, 18 October 2016 06:52 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane BegaudeauFriend
Messages: 458
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi Joerg,

In order to display a property color, based on an enumeration, you will need to enter the following expressions:
* labelExpression: aql:'Color:'
* valueExpression: aql:nameofyourpackage::Color.getEEnumLiteral(self.color.toString())
* candidatesExpression: aql:nameofyourpackage::Color.eLiterals
* candidateDisplayExpression: aql:candidate.name

And in order to edit this value, you will need a "Set" operation with the feature name "color" and the new value expression "newValue.instance". You will just need to replace in those expression the name of the package of your meta model containing your concept of "Color".

Kind regards,

Stephane Begaudeau

Re: Candidates Expression for Select or Radio based on ecore Enumeration [message #1745905 is a reply to message #1745829] Wed, 19 October 2016 07:01 Go to previous messageGo to next message
Joerg Hermann is currently offline Joerg HermannFriend
Messages: 15
Registered: September 2012
Location: Munich
Junior Member
Hi Stephane,
thanks a lot for your quick response, that is exactly what I was looking for.
-
best regards,
Joerg
Re: Candidates Expression for Select or Radio based on ecore Enumeration [message #1746525 is a reply to message #1745829] Mon, 31 October 2016 16:21 Go to previous message
Zoe Tsekas is currently offline Zoe TsekasFriend
Messages: 7
Registered: October 2016
Junior Member
I was able to display the Radio group, but whenever I selected a radio button it doesn't seem to fire the notification. I did add the "Is enabled expression" to "aql:true"
Previous Topic:Sirius-Import new edges design
Next Topic:How to force refresh of Properties View
Goto Forum:
  


Current Time: Fri Sep 20 08:18:35 GMT 2024

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

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

Back to the top