ro.sync.ecss.css.Styles getPseudoLevel() only returns 0 or 1

Post here questions and problems related to oXygen frameworks/document types.
Johann
Posts: 66

ro.sync.ecss.css.Styles getPseudoLevel() only returns 0 or 1

Fri Mar 04, 2016 6:08 pm

Hello everyone,

I am using the author component (SDK version 17.1.0.1). I have created a class which implements ro.sync.ecss.extensions.api.StylesFilter.
My .framework file calls this class in the "cssStylesFilterExtension" field.

My .framework file also calls a CSS file containing several pseudo elements at different pseudo levels. Example :

Code: Select all

procedure:before(1) {
  content: "before 1";
  background-color: red;
}
procedure:before(2) {
  content: "before 2";
  background-color: green;
}
procedure:before(3) {
  content: "before 3";
  background-color: blue;
}


When I open my XML file, I can see that the different contents and styles have been applied.

I would like to change programmatically in my "StylesFilter" class the styles of these pseudo elements so I tried to get the pseudoLevel of the current styles by using :

Code: Select all

styles.getPseudoLevel()


BUT it always returns 0 or 1 for all type of nodes (NODE_TYPE_PSEUDO_ELEMENT or NODE_TYPE_ELEMENT).

Can you help me on this ?

Thanks.

Johann
Radu
Posts: 5585

Re: ro.sync.ecss.css.Styles getPseudoLevel() only returns 0 or 1

Mon Mar 07, 2016 10:53 am

Hi Johann,

Indeed this is a limitation of the current API. I will add an issue to see if we can remove it in a future version, possibly in Oxygen 18 and possibly by adding a special interface to call for such levels.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Dan
Posts: 273

Re: ro.sync.ecss.css.Styles getPseudoLevel() only returns 0 or 1

Tue Mar 08, 2016 11:41 am

Hi Johann,

We changed the way the StylesFilter.filter() gets called for pseudo elements.
Now it works also for higher level pseudo elements but only if they have been defined in the CSS (i.e. they have a 'content' property). You can change this content from the filter method. The level is accessible through Styles.getPseudoLevel()

This will be available in the next Oxygen version (v18).

Best regards,
Dan
Johann
Posts: 66

Re: ro.sync.ecss.css.Styles getPseudoLevel() only returns 0 or 1

Tue Mar 08, 2016 11:46 am

Hey !

Thank you both for this information !

Regards,

Johann

Return to “SDK-API, Frameworks - Document Types”

Who is online

Users browsing this forum: No registered users and 1 guest