19. gadget

gadget(className, param, ..., param).

This pseudo-function is similar to the component pseudo-function except that it creates flightweight gadgets instead of standard Java™ AWT Components or Swing JComponents.

className is the name of a Java class which implements the interface com.xmlmind.xmledit.styledview.GadgetFactory (see Chapter 7, All stylesheet extension points).


caption:before {
    content: gadget("com.xmlmind.xmledit.cssext.Collapser", 
                    collapsed-icon, icon(collapsed-right),
                    expanded-icon, icon(expanded-up)) " ";

When gadget() is used to generate replaced content for a processing-instruction, the specified class must implement interface com.xmlmind.xmledit.styledview.GadgetFactory2 (see Chapter 7, All stylesheet extension points). Example, the following rule is used to style a “remark” inserted by a reviewer:

*::processing-instruction(xxe-remark) {
    display: inline;
    content: gadget("com.xmlmind.xmleditapp.cmd.diff.RemarkIndicator");
    font-size: inherit;
    background-color: transparent;