Control available styles based on schema
Posted: Wed Feb 05, 2025 11:35 pm
Hello!
I'm working with Oxygen XML Web Author version 27. The edited files are XML and the schema is provided inside an attribute of the root element.
I have two main styles for viewing files (available on "Choose style..." dialog from main toolbar).
I want to read the attribute from the root element and hide a style option if the current schema cannot be represented by this style.
I tried to use an extension of AuthorCSSAlternativesCustomizer and added it using PluginWorkspaceProvider.getPluginWorkspace().addAuthorCSSAlternativesCustomizer(AuthorCSSAlternativesCustomizer).
I put some logs to test if the extended functions were being called, but nothing happened.
Is there a specific way to add the customizer or a specific place where it must be initialized? Am I looking at the right class?
I also wanted to always open files with a default style option. Currently, the last selected option persists for the current user.
Thanks!
Vitor
I'm working with Oxygen XML Web Author version 27. The edited files are XML and the schema is provided inside an attribute of the root element.
I have two main styles for viewing files (available on "Choose style..." dialog from main toolbar).
I want to read the attribute from the root element and hide a style option if the current schema cannot be represented by this style.
I tried to use an extension of AuthorCSSAlternativesCustomizer and added it using PluginWorkspaceProvider.getPluginWorkspace().addAuthorCSSAlternativesCustomizer(AuthorCSSAlternativesCustomizer).
I put some logs to test if the extended functions were being called, but nothing happened.
Is there a specific way to add the customizer or a specific place where it must be initialized? Am I looking at the right class?
I also wanted to always open files with a default style option. Currently, the last selected option persists for the current user.
Thanks!
Vitor