Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Hide compartments in a Block using CSS
Hide compartments in a Block using CSS [message #1705805] Wed, 19 August 2015 09:35 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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;
> }
Re: Hide compartments in a Block using CSS [message #1705930 is a reply to message #1705928] Thu, 20 August 2015 08:52 Go to previous message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi,

This definitely looks like a bug in the compartments layout

Camille


Camille Letavernier
Previous Topic:[Sequence diagram] Inheritance and import issues
Next Topic:Moka instantiate execution engine
Goto Forum:
  


Current Time: Thu Apr 18 02:33:53 GMT 2024

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

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

Back to the top