Skip to main content



      Home
Home » Eclipse Projects » Sirius » Conditional style for EMF Map entries as Nodes in List container
Conditional style for EMF Map entries as Nodes in List container [message #1766828] Tue, 27 June 2017 12:53
Eclipse UserFriend
Hello everyone,

Configuration :
Eclipse
Version: Neon.3 (4.6.3)
Build id: M20170301-0400
Sirius
4.1.4.201703211416

I try to apply a conditional style on nodes that are elements of a list.
I followed the recommandations for building a Map in Ecore :
https://wiki.eclipse.org/EMF/FAQ#How_do_I_create_a_Map_in_EMF.3F

My ecore model is as below :
ServiceInformations : EClass
EReference (0...*,containement=true) serviceInformations : StringToStringMap

StringToStringMap : EClass
Instance type name : java.util.Map$Entry
key : EString
value : EString

My sirius specification model :

ServiceInformationsContainer
Domain class : System.ServiceInformations
Semantic candidate : feature:serviceInformations
Children presentation : List

SubNode of ServiceInformationsContainer
Domain class : System.StringToStringMap
Semantic candidate : feature:serviceInformations
Styles :
Default : Square grey with black label
Conditional Style : [self.target.eGet('key') = 'cpu' and self.target.eGet('value') = '10%' /] : Square grey with red label

You can see with the screenshots that the default style works great.
But the conditional style is not working, although the expression is evaluate as "true" when I enter the expression in the "Interpreter" view (with the list item "cpu : 10%" is selected). The following expression is also evaluate as "true" :
[ self.name.contains('cpu') and self.name.contains('10%')/]
but it is more a workaround...

My problem is that the list item "cpu : 10%" is not in red in my diagram.
I try to delete the diagram, and regenerate it but it doesn't work.

Thanks for your help !



Previous Topic:Changing the default label provider of the Model Explorer
Next Topic:A node is source of a relation only once
Goto Forum:
  


Current Time: Tue Jul 08 03:09:59 EDT 2025

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

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

Back to the top