Class AbstractHeaderRenderStrategy

All Implemented Interfaces:
Direct Known Subclasses:
ChildFirstHeaderRenderStrategy, ParentFirstHeaderRenderStrategy

public abstract class AbstractHeaderRenderStrategy extends Object implements IHeaderRenderStrategy
An abstract implementation of a header render strategy which is only missing the code to traverse the child hierarchy, since the sequence of that traversal is what will make the difference between the different header render strategies. Besides the child hierarchy the render sequence by default (may be changed via subclassing) is as follows:
  • 1. application level headers
  • 2. the root component's headers
  • 3. the children hierarchy (to be implemented per subclass)
Juergen Donnerstag
  • Constructor Details

  • Method Details

    • get

      public static IHeaderRenderStrategy get()
      Gets the strategy registered with the application
    • renderHeader

      public void renderHeader(HtmlHeaderContainer headerContainer, HtmlHeaderContainer.HeaderStreamState headerStreamState, Component rootComponent)
      Description copied from interface: IHeaderRenderStrategy
      Implements the render strategy
      Specified by:
      renderHeader in interface IHeaderRenderStrategy
      headerContainer - The HeaderContainer associated to the response
      headerStreamState - the header section of the page, when null, this section will not be rendered
      rootComponent - The root component (e.g. Page) to start the render process
    • renderRootComponent

      protected void renderRootComponent(HtmlHeaderContainer headerContainer, HtmlHeaderContainer.HeaderStreamState headerStreamState, Component rootComponent)
      Render the root component (e.g. Page).
      headerContainer -
      headerStreamState -
      rootComponent -
    • renderInlineEnclosure

      protected void renderInlineEnclosure(HtmlHeaderContainer container, InlineEnclosure enclosure)
      Searches for the siblings of the given enclosure for the controller of the given enclosure and renders that controller's header contributions. This is done explicitly because when an enclosed component is added to the AjaxRequestTarget and is consequently replaced for render by the enclosure, the component's header contributions would not make it to the response as the enclosure is a sibling of the component in the hierarchy and only children's header contributions are added to the response. Fixes WICKET-6459
      container - the header container to render the header contributions of the enclosure's controller
      enclosure - the enclosure whose controller's contributions are going to be rendered
    • renderChildHeaders

      protected abstract void renderChildHeaders(HtmlHeaderContainer headerContainer, Component rootComponent)
      Render the child hierarchy headers.
      headerContainer -
      rootComponent -
    • renderApplicationLevelHeaders

      protected final void renderApplicationLevelHeaders(HtmlHeaderContainer headerContainer)
      Render the application level headers
      headerContainer -