Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » CSS: Compartment selectors documentaton
CSS: Compartment selectors documentaton [message #1262259] Mon, 03 March 2014 07:31 Go to next message
Klaas Gadeyne is currently offline Klaas Gadeyne
Messages: 86
Registered: July 2009
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 #1262291 is a reply to message #1262259] Mon, 03 March 2014 08:17 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille Letavernier
Messages: 440
Registered: February 2011
Senior Member
Hi Klaas,

The CSS documentation is not yet up-to-date. That's not really the priority around M6 Smile

Stereotype compartments are simply not supported yet.

Regards,
Camille
Re: CSS: Compartment selectors documentaton [message #1278459 is a reply to message #1262291] Thu, 27 March 2014 07:12 Go to previous messageGo to next message
Logan M is currently offline Logan M
Messages: 8
Registered: October 2013
Location: Toulouse
Junior Member
There's any way to find "ElementType" and "Property" that can be used as CSS selectors ? (such as looking some where in the source code at least)

Same for style properties ("GMF properties") that can be applied on the specific element ?
Re: CSS: Compartment selectors documentaton [message #1278528 is a reply to message #1278459] Thu, 27 March 2014 09:05 Go to previous message
Camille Letavernier is currently offline Camille Letavernier
Messages: 440
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
Previous Topic:Step by step tutorial
Next Topic:PAPYRUS 0.10.X & ALF EDITOR
Goto Forum:
  


Current Time: Sun Aug 31 02:35:52 EDT 2014

Powered by FUDForum. Page generated in 0.01811 seconds