Class AbstractHeaderRenderStrategy
- java.lang.Object
-
- org.apache.wicket.markup.renderStrategy.AbstractHeaderRenderStrategy
-
- All Implemented Interfaces:
IHeaderRenderStrategy
- 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)
- Author:
- Juergen Donnerstag
-
-
Constructor Summary
Constructors Constructor Description AbstractHeaderRenderStrategy()
Construct.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static IHeaderRenderStrategy
get()
protected void
renderApplicationLevelHeaders(HtmlHeaderContainer headerContainer)
Render the application level headersprotected abstract void
renderChildHeaders(HtmlHeaderContainer headerContainer, Component rootComponent)
Render the child hierarchy headers.void
renderHeader(HtmlHeaderContainer headerContainer, HtmlHeaderContainer.HeaderStreamState headerStreamState, Component rootComponent)
Implements the render strategyprotected 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.protected void
renderRootComponent(HtmlHeaderContainer headerContainer, HtmlHeaderContainer.HeaderStreamState headerStreamState, Component rootComponent)
Render the root component (e.g.
-
-
-
Constructor Detail
-
AbstractHeaderRenderStrategy
public AbstractHeaderRenderStrategy()
Construct.
-
-
Method Detail
-
get
public static IHeaderRenderStrategy get()
- Returns:
- 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 interfaceIHeaderRenderStrategy
- Parameters:
headerContainer
- The HeaderContainer associated to the responseheaderStreamState
- the header section of the page, when null, this section will not be renderedrootComponent
- 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).- Parameters:
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 theAjaxRequestTarget
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- Parameters:
container
- the header container to render the header contributions of the enclosure's controllerenclosure
- 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.- Parameters:
headerContainer
-rootComponent
-
-
renderApplicationLevelHeaders
protected final void renderApplicationLevelHeaders(HtmlHeaderContainer headerContainer)
Render the application level headers- Parameters:
headerContainer
-
-
-