CSS: Compartment selectors documentaton [message #1262259] |
Mon, 03 March 2014 12:31 |
Klaas Gadeyne Messages: 165 Registered: July 2009 |
Senior Member |
|
|
Hi,
As per [https://bugs.eclipse.org/bugs/show_bug.cgi?id=417178] it should now be possible to select certain compartments using CSS. For instance
Class > Compartment[kind="symbol"] {
visible:false;
}
Class > Compartment[kind="operations"] {
visible:false;
}
works fine. I also figured out that the "kind" of the "Nested Classifiers" compartment should be selected as
Class > Compartment[kind="nestedclassifiers"]{
visible:false;
}
(that is, omitting the space)
In case of stereotyped elements, there's always a compartment created carrying the name of the stereotype (or more correct, its name is <<StereotypeName>>. However, I don't succeed in selecting this compartment. For instance, with a stereotype "Stereotype1", the following does not work (luna M5, papyrus nightly build)
Class > Compartment[kind="Stereotype1"]{
visible:true;
}
(nor when I replace Stereotype1 with stereotype1 above)
What would the kind of this stereotype1 compartment be?
Maybe more generally, is there a place (in the source code/documentation) where these rules are to be found?
TIA,
Klaas
|
|
|
|
|
Re: CSS: Compartment selectors documentaton [message #1278528 is a reply to message #1278459] |
Thu, 27 March 2014 13:05 |
Camille Letavernier Messages: 952 Registered: February 2011 |
Senior Member |
|
|
Hi Logan,
The ElementType and Properties selectors are based on the underlying Ecore Metamodel (i.e. UML, but it could work with other Ecore languages), e.g.:
Class[isAbstract=true] /* EClass "uml::Class", EAttribute "isAbstract" */
For uml::NamedElement or ecore::ENamedElement references, you can use the name of the reference as the property value, e.g.:
Property[type=String] /* type is a reference to the NamedElement String */
For supported Graphical properties, they are the ones from the GMF Notation Metamodel. The same ones are used in the Appearance tab of the Properties View:
* {
fontColor: black; /* From notation::FontStyle::fontColor */
fillColor: white; /* From notation::FillStyle::fillColor */
}
You can find them from the Appearance tab in the properties view: hover a widget, then look at the Tooltip (It contains the exact java-compliant case, which is the one used in the CSS stylesheets). For example, "Font color" becomes "fontColor".
There are some additional Papyrus-specific Properties. They are described in the CSS Documentation (The list is almost exhaustive, but it keeps growing, and the documentation is a few weeks behind)
Because the CSS Engine is highly generic, it is not possible to make an exhaustive list (Most GMF NamedStyle are supported, so you could add your own graphical properties without having to modify, or even extend, the CSS Engine). It is also extensible (CSS pseudo-classes can be added dynamically, and it is possible to rewrite or extend the DOM model via an extension point).
The CSS documentation is not badly outdated, so most information is already there.
Regards,
Camille
Camille Letavernier
|
|
|
Powered by
FUDForum. Page generated in 0.03580 seconds