Class AbstractMarkupSourcingStrategy
- java.lang.Object
-
- org.apache.wicket.markup.html.panel.AbstractMarkupSourcingStrategy
-
- All Implemented Interfaces:
IMarkupSourcingStrategy
- Direct Known Subclasses:
AssociatedMarkupSourcingStrategy,DefaultMarkupSourcingStrategy,FragmentMarkupSourcingStrategy
public abstract class AbstractMarkupSourcingStrategy extends java.lang.Object implements IMarkupSourcingStrategy
Implements boilerplate as needed by many markup sourcing strategies.- Author:
- Juergen Donnerstag
-
-
Constructor Summary
Constructors Constructor Description AbstractMarkupSourcingStrategy()Construct.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract IMarkupFragmentgetMarkup(MarkupContainer container, Component child)Will replace the respective component's method.voidonComponentTag(Component component, ComponentTag tag)Make sure we open up open-close tags to open-body-closevoidonComponentTagBody(Component component, MarkupStream markupStream, ComponentTag openTag)Skip the components body which is expected to be raw markup only (no wicket components).voidrenderHead(Component component, HtmlHeaderContainer container)Empty.protected IMarkupFragmentsearchInNestedTransparentResolvers(IMarkupFragment containerMarkup, Component child, java.util.List<MarkupContainer> componentResolvers)Search for the markup of a child that might be nested inside transparent siblings.protected IMarkupFragmentsearchMarkupInTransparentResolvers(MarkupContainer container, IMarkupFragment containerMarkup, Component child)If the child has not been directly added to the container, but via a TransparentWebMarkupContainer, then we are in trouble.
-
-
-
Method Detail
-
getMarkup
public abstract IMarkupFragment getMarkup(MarkupContainer container, Component child)
Description copied from interface:IMarkupSourcingStrategyWill replace the respective component's method. However by returning null, the component's method will be called.- Specified by:
getMarkupin interfaceIMarkupSourcingStrategy- Parameters:
container- The parent containing the child. This is not the direct parent, transparent componentresolvermay be in the hierarchy between.child- The component to find the markup for.- Returns:
- the markup fragment for the child, or
null. - See Also:
MarkupContainer.getMarkup(Component)
-
searchMarkupInTransparentResolvers
protected IMarkupFragment searchMarkupInTransparentResolvers(MarkupContainer container, IMarkupFragment containerMarkup, Component child)
If the child has not been directly added to the container, but via a TransparentWebMarkupContainer, then we are in trouble. In general Wicket iterates over the markup elements and searches for associated components, not the other way around. Because of TransparentWebMarkupContainer (or more generally resolvers), there is no "synchronous" search possible.- Parameters:
container- the parent container.containerMarkup- the markup of the parent container.child- The component to find the markup for.- Returns:
- the markup fragment for the child, or
null.
-
searchInNestedTransparentResolvers
protected IMarkupFragment searchInNestedTransparentResolvers(IMarkupFragment containerMarkup, Component child, java.util.List<MarkupContainer> componentResolvers)
Search for the markup of a child that might be nested inside transparent siblings. For example:<div wicket:id="outerTransparent"> <div wicket:id="innerTransparent"> <span wicket:id="childComponent"></span> </div> </div>- Parameters:
containerMarkup- the markup of the parent container.child- The component to find the markup for.componentResolvers- the transparent siblings- Returns:
- the markup fragment for the child, or
null.
-
onComponentTag
public void onComponentTag(Component component, ComponentTag tag)
Make sure we open up open-close tags to open-body-close- Specified by:
onComponentTagin interfaceIMarkupSourcingStrategy- Parameters:
component- The component calling the strategy- See Also:
Component.onComponentTag(ComponentTag)
-
onComponentTagBody
public void onComponentTagBody(Component component, MarkupStream markupStream, ComponentTag openTag)
Skip the components body which is expected to be raw markup only (no wicket components). It will be replaced by the associated markup.- Specified by:
onComponentTagBodyin interfaceIMarkupSourcingStrategy- Parameters:
component- The component calling the strategy- See Also:
Component.onComponentTagBody(MarkupStream, ComponentTag)
-
renderHead
public void renderHead(Component component, HtmlHeaderContainer container)
Empty. Nothing to be added to the response by default.- Specified by:
renderHeadin interfaceIMarkupSourcingStrategy- Parameters:
component- The component calling the strategy- See Also:
Component.internalRenderHead(HtmlHeaderContainer)
-
-