Module org.apache.wicket.core
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
-
Method Summary
Modifier and TypeMethodDescriptionabstract 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 Details
-
AbstractMarkupSourcingStrategy
public AbstractMarkupSourcingStrategy()Construct.
-
-
Method Details
-
getMarkup
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:
-
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
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:
-
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:
-
renderHead
Empty. Nothing to be added to the response by default.- Specified by:
renderHead
in interfaceIMarkupSourcingStrategy
- Parameters:
component
- The component calling the strategy- See Also:
-