Horizontal Layout Widget

As described earlier, this widget is a component renderer which is not associated with a domain definition, instead it is associated with a "style". A separate configuration file is used for component renderers. The StylesConfig.xml file should be added to the client application component, or the existing file should be modified if it already exists, to associate the component-renderer plug-in class with the horizontal-layout style as shown below.

Figure 1. Configuring the Horizontal Layout Widget
<?xml version="1.0" encoding="ISO-8859-1"?>
<sc:styles
  <sc:style name="horizontal-layout">
    <sc:plug-in name="component-renderer"
                class="sample.HorizontalLayoutRenderer"/>
  </sc:style>
</sc:styles>

The horizontal-layout style is what the "Person Context Panel Widget" used when delegating to the "Horizontal Layout widget" i.e.

ContainerBuilder cb
      = ComponentBuilderFactory.createContainerBuilder();
    cb.setStyle(context.getStyle("horizontal-layout"));

When the Container component is rendered, the sample.HorizontalLayoutRenderer class will be used. If a new renderer class is developed to achieve the horizontal layout using a different HTML technique, the horizontal-layout style can simply be re-configured to associate it with another renderer class. As long as that class takes the same input (a Container component), other widgets which use this style will not require any update.

More information about configuring renderers and other plug-ins is provided in Configuring Renderers.