Thank you for your help. Will try that and keep you inform.
BR
On 20 août 2014 at 16:40:45, LETAVERNIER Camille (camille.letavernier@xxxxxx) wrote:
You may try to add a breakpoint on this method, in plug-in
oep.infra.gmfdiag.css:
org.eclipse.papyrus.infra.gmfdiag.css.resource.CSSNotationResource.getEngine(Resource)
and see whether it returns something. It should return the
CSSEngine associated to your Notation resource, but I think the
method is over-constrained.
In theory, to use the Papyrus CSS capability, all you need to do is
call CSSHelper.installCSSSupport(ResourceSet) before loading
anything.
HTH,
Camille
De : mdt-papyrus.dev-bounces@xxxxxxxxxxx
[mailto:mdt-papyrus.dev-bounces@xxxxxxxxxxx] De la part de
Mikaël Barbero
Envoyé : mercredi 20 août 2014 16:10
À : Papyrus Project list
Objet : Re: [mdt-papyrus.dev] Stylesheets contributed
through extension point vs applied directly
Thank you for the quick answer.
I confirm that I have a project and the diagram is in a resource in
a notation resource.
Actually, everything is fine when I open the diagram with the
papyrus editor, but not when I use my
DiagramGraphicalViewer. Any idea?
On 20 août 2014 at 15:39:20, LETAVERNIER Camille (camille.letavernier@xxxxxx)
wrote:
Hi Mikaël,
This is quite surprising, since the extension point is read by a
singleton, which should always be the top-level CSS Engine in the
hierarchy (i.e. always active).
The expected hierarchy of CSS Engines is: Diagram > Model
(Resource) > Project > Workspace (Theme/Extension point) >
Base (hard-coded)
Maybe you’re in a situation where you don’t have a project? In
which case the hierarchy might be broken and doesn’t propagate to
the Workspace Theme (This would definitely be a bug, but since this
is a situation which hasn’t been expected, this wouldn’t be too
surprising).
I just looked at the code, and if you don’t have a Project, then
the Workspace CSS Engine is returned instead, so this shouldn’t
break the hierarchy. Then maybe you’re in a case where the diagram
isn’t in a resource? Or a resource which is not a notation
resource? (I see some tests which might be a little bit too
restrictive)
Regards,
Camille
I’m trying to display a Papyrus model with stylesheets applied
within a standard GMF viewer (DiagramGraphicalViewer). It
works well for stylesheets applied directly on model elements but
those contributed through extension points do not work
(org.eclipse.papyrus.infra.gmfdiag.css.theme).
What do I have to do to "activate" the stylesheets contributed
through the theme extension point?
Don't you think it would be better if the stylesheets work the same
way whatever how they contributed?
_______________________________________________
mdt-papyrus.dev mailing list
mdt-papyrus.dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/mdt-papyrus.dev
_______________________________________________
mdt-papyrus.dev mailing list
mdt-papyrus.dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/mdt-papyrus.dev
|