24.08.2015 Views

Oxygen XML Author plugin 13.2.0

Oxygen XML Author plugin 13.2.0

Oxygen XML Author plugin 13.2.0

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

When the above implementation is configured, the reference has the expected layout:<strong>Author</strong> Developer Guide | 220Figure 108: Reference with reference resolverConfiguring CSS Styles FilterYou can modify the CSS styles for each ro.sync.ecss.extensions.api.node.<strong>Author</strong>Node rendered inthe <strong>Author</strong> mode using an implementation of ro.sync.ecss.extensions.api.StylesFilter. You canimplement the various callbacks of the interface either by returning the default value given by <strong>Oxygen</strong> <strong>XML</strong> <strong>Author</strong><strong>plugin</strong> or by contributing to the value. The received styles ro.sync.ecss.css.Styles can be processed andvalues can be overwritten with your own. For example you can override the KEY_BACKGROUND_COLOR style to returnyour own implementation of ro.sync.exml.view.graphics.Color or override the KEY_FONT style to returnyour own implementation of ro.sync.exml.view.graphics.Font.Note: The Javadoc documentation of the <strong>Author</strong> API used in the example files is available on the <strong>Oxygen</strong> <strong>XML</strong>website. Also it can be downloaded as a zip archive from the website.For instance in our simple document example the filter can change the value of the KEY_FONT property for the tableelement:package simple.documentation.framework;import ro.sync.ecss.css.Styles;import ro.sync.ecss.extensions.api.StylesFilter;import ro.sync.ecss.extensions.api.node.<strong>Author</strong>Node;import ro.sync.exml.view.graphics.Font;public class SDFStylesFilter implements StylesFilter {public Styles filter(Styles styles, <strong>Author</strong>Node authorNode) {if (<strong>Author</strong>Node.NODE_TYPE_ELEMENT == authorNode.getType()&& "table".equals(authorNode.getName())) {styles.setProperty(Styles.KEY_FONT, new Font(null, Font.BOLD, 12));}}}return styles;Configuring a Table Column Width ProviderIn the documentation framework the table element as well as the table columns can have specified widths. In orderfor these widths to be considered by <strong>Author</strong> we need to provide the means to determine them. As explained in the Stylingthe Table Element section which describes the CSS properties needed for defining a table, if you use the table elementattribute width <strong>Oxygen</strong> <strong>XML</strong> <strong>Author</strong> <strong>plugin</strong> can determine the table width automatically. In this example the table hascol elements with width attributes that are not recognized by default. You will need to implement a Java extensionclass to determine the column widths.Note: The Javadoc documentation of the <strong>Author</strong> API used in the example files is available on the <strong>Oxygen</strong> <strong>XML</strong>website. Also it can be downloaded as a zip archive from the website.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!