Class AssociatedMarkupSourcingStrategy
- java.lang.Object
-
- org.apache.wicket.markup.html.panel.AbstractMarkupSourcingStrategy
-
- org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy
-
- All Implemented Interfaces:
IMarkupSourcingStrategy
- Direct Known Subclasses:
BorderMarkupSourcingStrategy
,PanelMarkupSourcingStrategy
public abstract class AssociatedMarkupSourcingStrategy extends AbstractMarkupSourcingStrategy
Boilerplate for a markup sourcing strategy which retrieves the markup from associated markup files.- Author:
- Juergen Donnerstag
-
-
Constructor Summary
Constructors Constructor Description AssociatedMarkupSourcingStrategy(String tagName)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IMarkupFragment
findMarkupInAssociatedFileHeader(MarkupContainer container, Component child)
Search the child's markup in the header section of the markupIMarkupFragment
getMarkup(MarkupContainer parent, Component child)
Search for the child's markup in the associated markup file.void
onComponentTag(Component component, ComponentTag tag)
Make sure we open up open-close tags to open-body-closeprotected void
renderAssociatedMarkup(Component component)
Render the associated markup markupvoid
renderHead(Component component, HtmlHeaderContainer container)
Render the header from the associated markup filevoid
renderHeadFromAssociatedMarkupFile(WebMarkupContainer container, HtmlHeaderContainer htmlContainer)
Called by components like Panel and Border which have associated Markup and which may have a <wicket:head> tag.-
Methods inherited from class org.apache.wicket.markup.html.panel.AbstractMarkupSourcingStrategy
onComponentTagBody, searchInNestedTransparentResolvers, searchMarkupInTransparentResolvers
-
-
-
-
Constructor Detail
-
AssociatedMarkupSourcingStrategy
public AssociatedMarkupSourcingStrategy(String tagName)
Constructor.- Parameters:
tagName
- Either "panel" or "border"
-
-
Method Detail
-
onComponentTag
public void onComponentTag(Component component, ComponentTag tag)
Description copied from class:AbstractMarkupSourcingStrategy
Make sure we open up open-close tags to open-body-close- Specified by:
onComponentTag
in interfaceIMarkupSourcingStrategy
- Overrides:
onComponentTag
in classAbstractMarkupSourcingStrategy
- Parameters:
component
- The component calling the strategy- See Also:
Component.onComponentTag(ComponentTag)
-
renderAssociatedMarkup
protected final void renderAssociatedMarkup(Component component)
Render the associated markup markup- Parameters:
component
-
-
getMarkup
public IMarkupFragment getMarkup(MarkupContainer parent, Component child)
Search for the child's markup in the associated markup file.- Specified by:
getMarkup
in interfaceIMarkupSourcingStrategy
- Specified by:
getMarkup
in classAbstractMarkupSourcingStrategy
- Parameters:
parent
- The container expected to contain the markup for childchild
- The child component to find the markup for- Returns:
- The markup associated with the child
- See Also:
MarkupContainer.getMarkup(Component)
-
findMarkupInAssociatedFileHeader
public IMarkupFragment findMarkupInAssociatedFileHeader(MarkupContainer container, Component child)
Search the child's markup in the header section of the markup- Parameters:
container
-child
-- Returns:
- Null, if not found
-
renderHead
public void renderHead(Component component, HtmlHeaderContainer container)
Render the header from the associated markup file- Specified by:
renderHead
in interfaceIMarkupSourcingStrategy
- Overrides:
renderHead
in classAbstractMarkupSourcingStrategy
- Parameters:
component
- The component calling the strategy- See Also:
Component.internalRenderHead(HtmlHeaderContainer)
-
renderHeadFromAssociatedMarkupFile
public final void renderHeadFromAssociatedMarkupFile(WebMarkupContainer container, HtmlHeaderContainer htmlContainer)
Called by components like Panel and Border which have associated Markup and which may have a <wicket:head> tag.Whereas 'this' might be a Panel or Border, the HtmlHeaderContainer parameter has been added to the Page as a container for all headers any of its components might wish to contribute to.
The headers contributed are rendered in the standard way.
- Parameters:
container
-htmlContainer
- The HtmlHeaderContainer added to the Page
-
-