|
Re: Providing default style for notation element [message #1738433 is a reply to message #1738432] |
Tue, 19 July 2016 19:37 |
|
Hi,
Yes, the idomatic "Papyrus way" is to use CSS to control the styling of
your diagrams. This includes the 'canonical' style which, although
perhaps not a style in the traditional sense, is implemented in the GMF
run-time (and therefore in Papyrus) as a notation style.
So, something like:
Class {
canonical: true;
}
in a stylesheet makes all views of classes synchronized. And this:
* {
canonical: true;
}
makes all views in a diagram synchronized.
Stylesheets can be attached to a specific diagram, to a model, to a
project, or to the entire workspace. They can be applied by reference
to *.css resources in the workspace or (in the case of model/diagram
stylesheets) by reference to stylesheet text embedded in the model,
itself.
Look for documentation in the on-line help, in a "CSS Stylesheets"
topic under the "Papyrus Guide". Sorry, I can't provide a web link
because the Papyrus help isn't (yet) published to help.eclipse.org.
HTH,
Christian
On 2016-07-19 19:27:06 +0000, Leonid Ripeynih said:
> Hello!
>
> I'd like to provide default style for some elements in my diagram.
> Basically what I need is some kind of callback like:
>
> viewAboutToBeCreated(Element domain, View view) {
> ..
> }
>
> Where I can analyze domain elements and set some styles in view. (I
> want to automatically set style to sync view with a model)
> As I'm writing It it seems to me that setting a listener on editing
> domain and listening for view creation should work. But I wonder, is
> there more idiomatic, papyrus/gmf specific way of doing it, maybe
> better integrated with style application lifecycle?
>
> Thanks in advance!
|
|
|
Powered by
FUDForum. Page generated in 0.03451 seconds