Community
Participate
Working Groups
Some refactoring of the properties view took place a short while ago, cannot say exactly when, but it affected how and when elements and their labels is displayed under the appearance tab. Anyway... The following CSS rule for customizing port labels no longer works: /* Rule for displaying only the name of the port in its label */ Port > Label { maskLabel: name; /* maskLabel: name type; */ /* This one displays both the name and the type */ } This CSS rule is working in Papyrus version 1.0.0.v201405150454 This CSS rule STOPPED working in the version 1.0.0.v201405271626 ...and is not working in version 1.0.0.v201406041426 ALSO: If the port has a stereotype applied some annoying <<stereotype>> noise pops up for the port in the diagram, and it cannot be removed/hidden in the diagram, and therefore we cannot create a CSS rule for removing it, right? The strange thing is that in the properties view it has been set to NOT display the stereotype for the port, but the <<stereotype>> pops up anyway, right next to the port, and as a separate label. Some time ago we got the stylesheet support for removing the <<component>> noise in component names. There should be the same kind of support for port labels.
The rule has been simplified to: Port { maskLabel: name; } although the initial intention was to allow both rules ('Port' and 'Port > Label'), to ensure "backwards" compatibility... Looks like we missed something. This is more consistent with how it is done for Properties.
Yes, the simplified rule works for masking out e.g. type and multiplicity, but it doesn't mask out the additional <<stereotypename>> label that pops up when a stereotype is applied on the port.
For the <<Stereotype>> tag, the RobotML diagrams use this rule to hide it: Port>Label:stereotype{visible: false;} However, there seems to be some refresh issues (i.e. the rule doesn't seem to work until you reopen the diagram) Is this a regression? I don't think we changed anything related to this specific rule.
In Comment 1 you say that the rule has been simplified. The change is that the >Label is not used. I have tested both variants below, neither works. Port>Label:stereotype{visible: false;} Port:stereotype{visible: false;} I don't understand the semantics of the first colon in the rule. Port>Label: There is no info nor or example in Help about : before {.
The colon is partially documented in the "CSS / Syntax elements" chapter, and some examples are available under the "CSS / MaskLabel" chapter. It is currently used in two cases: - Handling events (Which is not supported in standard Papyrus yet) - Identifying specific labels (For elements which can have more than one label, including Associations and Ports) In this case, Label:Stereotype is more specific than Label: it matches only the Label used to display the stereotypes applied on the current element. However, as explained in Comment 3, there is a refresh issue with this rule: diagrams are not properly refreshed, and the rule is verified only once, when the diagram is first opened. So, these steps are expected to work: - Use this rule in a stylesshet: Port > Label:stereotype { visible: false; } - Create a stereotyped Port. The <<Stereotype>> label is displayed (While it shouldn't: refresh bug) - Restart the editor: the <<Stereotype>> label is now hidden Also note that, as soon as you show/hide a label manually, the CSS rule will be ignored: user actions always take precedence over CSS-defined rules
Port > Label:stereotype { visible: false; } works for stereotyped ports on a class in a structure diagram after closing and reopening the model, wrt the refresh issue. It does not work for stereotyped ports on components in component diagrams. Also, the <<stereotype>> label itself behaves a bit strange for ports on components. It cannot be positioned where I like it. When dragging the label, it jumps away to one of ~4 fixed positions close to the port.
Also, this functionality to "show/hide a label manually" to override the CSS rule seem to be broken. I tested this on the stereotyped class-port. I use this port rule in a stylesheet added to the default theme. I manually decide to display the stereotype on the port, and it gets visible. Next time I open the model (wrt to the refresh issue), the CSS rule has removed the stereotype label, but according to the Appearance properties the <<stereotype>> label should be visible on the port. I have also seen this for other CSS rules, that is, the CSS rules cannot be overridden manually. This is perhaps be covered as a separate bugzilla on broken CSS functionality?
Another example of "show/hide a manually" to override the CSS rule, which seem to be broken, is shapeVisibility for Lifelines. There is a CSS rule setting shapeVisibility to true for Lifelines. When selecting the Lifeline and setting shape visibility to false nothing happens. Next time the Lifeline is selected the shape visibility has been automatically set back to true.
Mars.1 with SysML1.4 0.8.1 today's nightly Customizing a label through CSS is still an issue to me. e.g. Class[appliedStereotypes~="Block"] Port > Label { maskLabel: name; } doesn't seem to do anything. Example built on information from https://wiki.eclipse.org/MDT/Papyrus/UserGuide/CSS
Ignore my own comment #9: I didn't read the initial comments correctly. The entry Class[appliedStereotypes~="Block"] Port { maskLabel: name; } works as expected as explained in comment #1.