5. ComponentFactory

What is a ComponentFactory?

A ComponentFactory is a factory creating a java.awt.Component for use as the custom view of an XML element.

Where to declare a ComponentFactory?

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

smiley {
    content: component("Smiley");
    font: normal normal small sans-serif;
    /* Needed to display the red border of the selection */
    display: inline-block;
    padding: 1px;

How to implement a ComponentFactory?

Implement interface ComponentFactory. See sample ComponentFactory.