Interface WidgetRenderer<T extends Widget>

  • Type Parameters:
    T - widget type

    public interface WidgetRenderer<T extends Widget>
    A widget renderer is responsible for rendering the caption and content of a widget.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      org.zkoss.zk.ui.api.HtmlBasedComponent createCaption​(T widget)
      Creates and returns the widget's caption component.
      org.zkoss.zk.ui.api.HtmlBasedComponent createContent​(T widget)
      Creates and returns the widget's (main) content component.
    • Method Detail

      • createCaption

        org.zkoss.zk.ui.api.HtmlBasedComponent createCaption​(T widget)
        Creates and returns the widget's caption component.

        Note: The renderer is not responsible for attaching the caption component to the passed widget instance. This is handled automatically during the widget initialization process.

        Parameters:
        widget - the widget component
        Returns:
        the created caption component
      • createContent

        org.zkoss.zk.ui.api.HtmlBasedComponent createContent​(T widget)
        Creates and returns the widget's (main) content component.

        Note: The renderer is not responsible for attaching the content component to the passed widget instance. This is handled automatically during the widget initialization process.
        However, some widgets (e.g. InputWidget) need to be able to access specific content components (e.g. input component) for updating purposes etc, which means that the renderer needs to pass those components to the widget directly. Please see InputWidget.setInputComponent(org.zkoss.zul.impl.api.InputElement) for an example.

        Parameters:
        widget - the widget component
        Returns:
        the created content component