Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 11:18 Go to next message
Sebastien GABEL is currently offline Sebastien GABELFriend
Messages: 16
Registered: July 2013
Junior Member
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 11:59 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
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


Camille Letavernier
Re: [CSS] Control stereotype display in figure label [message #1722952 is a reply to message #1722940] Wed, 10 February 2016 13:16 Go to previous messageGo to next message
Sebastien GABEL is currently offline Sebastien GABELFriend
Messages: 16
Registered: July 2013
Junior Member
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 14:56 Go to previous message
Johan Van Noten is currently offline Johan Van NotenFriend
Messages: 87
Registered: July 2009
Member
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: Fri Apr 26 09:16:58 GMT 2024

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

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

Back to the top