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 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 IMarkupFragment
getMarkup(MarkupContainer container, Component child)
Will replace the respective component's method.void
onComponentTag(Component component, ComponentTag tag)
Make sure we open up open-close tags to open-body-closevoid
onComponentTagBody(Component component, MarkupStream markupStream, ComponentTag openTag)
Skip the components body which is expected to be raw markup only (no wicket components).void
renderHead(Component component, HtmlHeaderContainer container)
Empty.protected IMarkupFragment
searchInNestedTransparentResolvers(IMarkupFragment containerMarkup, Component child, List<MarkupContainer> componentResolvers)
Search for the markup of a child that might be nested inside transparent siblings.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.
-
-
-
Constructor Detail
-
AbstractMarkupSourcingStrategy
public AbstractMarkupSourcingStrategy()
Construct.
-
-
Method Detail
-
getMarkup
public abstract IMarkupFragment getMarkup(MarkupContainer container, Component child)
Description copied from interface:IMarkupSourcingStrategy
Will replace the respective component's method. However by returning null, the component's method will be called.- Specified by:
getMarkup
in interfaceIMarkupSourcingStrategy
- Parameters:
container
- The parent containing the child. This is not the direct parent, transparent componentresolver
may 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, 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:
onComponentTag
in 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:
onComponentTagBody
in 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:
renderHead
in interfaceIMarkupSourcingStrategy
- Parameters:
component
- The component calling the strategy- See Also:
Component.internalRenderHead(HtmlHeaderContainer)
-
-