Skip to main content



      Home
Home » Modeling » Papyrus » [CSS] Control stereotype display in figure label
icon5.gif  [CSS] Control stereotype display in figure label [message #1722937] Wed, 10 February 2016 06:18 Go to next message
Eclipse UserFriend
The Appearance property page available in Papyrus Mars allows to control the stereotype display through a thin integration of the nattable framework. Good.
I'm attempting to do the same kind of things via CSS but I don't manage to find the "right" syntax to use (if existing and if supported).
I would like to let appear only the <<Block>> stereotype application in the top label where all stereotypes applied are displayed by default.

From the property page, this custom display can be achieved thanks to the column "visible".
Is there an equivalent CSS syntax to control this display ?
It would be something like:

[appliedStereotypes~=Block] {
displayStereotypes: false; => Hide everything. OK.
}

Then.....????

Reading the dedicated section [1] from the Papyrus user guide does not really help in this sense.



[1] https://wiki.eclipse.org/MDT/Papyrus/UserGuide/CSS/StereotypeDisplay
Re: [CSS] Control stereotype display in figure label [message #1722940 is a reply to message #1722937] Wed, 10 February 2016 06:59 Go to previous messageGo to next message
Eclipse UserFriend
Hi Sébastien,

Here's the syntax for manipulating individual stereotype labels:

Label[kind=StereotypeLabel]{ /* Hide all stereotype labels */
	visible: false;
}

Label[kind=StereotypeLabel][stereotype="SysML::Blocks::Block"] { /* Display the SysML Block Stereotype Label */
	visible: true;
}


Note that some customizations only work in UML Diagrams (SysML 1.1 diagrams have diverged a lot and may not support all styling capabilities. Especially, a lot of Stereotype tags are hard-coded in SysML Diagram Elements). This one seems to work in both UML and SysML 1.1 diagrams however, so it should be OK

HTH,
Camille
Re: [CSS] Control stereotype display in figure label [message #1722952 is a reply to message #1722940] Wed, 10 February 2016 08:16 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Camille!
It does the trick and it's exactly what I was looking for. I think it could be useful to complete the example given in the user guide, at least with the second part of the syntax.
Re: [CSS] Control stereotype display in figure label [message #1726096 is a reply to message #1722952] Wed, 09 March 2016 09:56 Go to previous message
Eclipse UserFriend
The notation seems to be very strict.

Label[kind=StereotypeLabel][stereotype="SysML::Blocks::Block"] { /* Display the SysML Block stereotype label */
	visible: false;
}


So, as compared to Camille's suggestion, I had to do:
* Label: uppercase instead of lowercase
* StereotypeLabel: CamelCase instead of lower case

In addition, it seems that also the stereotype needs to be fully qualified.
Label[kind=StereotypeLabel][stereotype="Block"]

does not seem to work. The full qualification SysML::Blocks::Block is required.
This is unexpected, since
Compartment[stereotype="Block"] {
	visible: false;
}

works fine.

Is this strictness expected? required?
Previous Topic:Carriage return on papyrus objects
Next Topic:Custom Palette creation
Goto Forum:
  


Current Time: Thu Jul 17 03:36:35 EDT 2025

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

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

Back to the top