Hide compartments in a Block using CSS [message #1705805] |
Wed, 19 August 2015 09:35 |
Eclipse User |
|
|
|
Dear all,
I would like to hide constraints and operations compartments in a Block
in SysML that has an stereotype applied by using CSS.
It works when I apply the CSS directly to a diagram. Nevertheless, when
I apply it by creating a plugin that contributes to Papyrus theme it's
not working. All other things such as colours and the like are working.
This is the code I use to hide both compartments:
[appliedStereotypes~=MyStereotype]> Compartment[kind=constraints],
[appliedStereotypes~=MyStereotype]> Compartment[kind=operations] {
visible:false;
}
Best,
Víctor
|
|
|
Re: Hide compartments in a Block using CSS [message #1705817 is a reply to message #1705805] |
Wed, 19 August 2015 11:04 |
Camille Letavernier Messages: 952 Registered: February 2011 |
Senior Member |
|
|
Hi Victor,
Did you check the Papyrus Theme to see whether your plug-in CSS File is properly included?
In Window > Preferences > Papyrus > CSS Theme, select Papyrus Theme and have a look at the list of stylesheets included
If it's properly set there, then it's probably a rule priority issue. All stylesheets deployed via a plug-in have the same priority, while diagram-local stylesheets have a higher priority. So when deploying a stylesheet via the extension point, you might get conflicts with SysML. To solve these conflicts, you need to augment the weight (priority) of your CSS rules, e.g. by appending explicitly the kind of diagram or element that is affected. For example:
InternalBlockDiagram Class[appliedStereotypes~=MyStereotype] > Compartment[kind=constraints] {
visible: false;
}
This rule has a higher priority, because it is more specific
http://www.w3.org/TR/CSS21/cascade.html#specificity
Regards,
Camille
Camille Letavernier
|
|
|
Re: Hide compartments in a Block using CSS [message #1705928 is a reply to message #1705817] |
Thu, 20 August 2015 08:22 |
Eclipse User |
|
|
|
Thanks a lot Camille.
Actually there was also another issue, that I don't know whether it's a
bug or not.
Before using only CSS I was using SVGs in the profiles, so I left them
even if they were not being used.
I notice that if a SVG is added to a profile regardless of whether the
symbol compartment is shown or not the Block layout gets messed up. The
name and stereotypes compartment disappears from the top of the block
and it's placed in the centre of the Block, overlapping operations and
constraints. I removed the SVG that wasn't use anymore and it works
properly.
Best,
Víctor
El 19/08/2015 a las 13:04, Camille Letavernier escribió:
> InternalBlockDiagram Class[appliedStereotypes~=MyStereotype] >
> Compartment[kind=constraints] {
> visible: false;
> }
|
|
|
|
Powered by
FUDForum. Page generated in 0.01996 seconds