7. StyledElementViewFactory

What is a StyledElementViewFactory?

A factory class used to create custom styled views (StyledElementView) for some elements. Such factory classes are used to implement the styled view of the XHTML ruby element and the styled views of most MathML elements.

Where to declare a StyledElementViewFactory?

In the CSS stylesheet used to style the document being edited, using the proprietary view() pseudo-function in XMLmind XML Editor - Support of Cascading Style Sheets (W3C CSS). XHTML ruby element example:

ruby {
    display: view("com.xmlmind.xmleditext.xhtml.RubyViewFactory");
    /* In fact what follows draws a grid. 
       It makes the structure of the ruby clearer. */
    padding: 1px;
    border: 1px solid #F0F0F0;
}

How to implement a StyledElementViewFactory?

Implement interface StyledElementViewFactory. See also TextNodeViewFactory.