Hide compartments in a Block using CSS [message #1705805] |
Wed, 19 August 2015 05: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 07:04   |
Eclipse User |
|
|
|
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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.34451 seconds