Class FragmentMarkupSourcingStrategy
- java.lang.Object
-
- org.apache.wicket.markup.html.panel.AbstractMarkupSourcingStrategy
-
- org.apache.wicket.markup.html.panel.FragmentMarkupSourcingStrategy
-
- All Implemented Interfaces:
IMarkupSourcingStrategy
public class FragmentMarkupSourcingStrategy extends AbstractMarkupSourcingStrategy
A markup sourcing strategy suitable for Fragment components.- Author:
- Juergen Donnerstag
-
-
Constructor Summary
Constructors Constructor Description FragmentMarkupSourcingStrategy(String markupId, MarkupContainer markupProvider)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IMarkupFragment
chooseMarkup(Component component)
Get the markup stream which shall be used to search for the fragmentIMarkupFragment
getMarkup(MarkupContainer container, Component child)
Search for the child's markup in the fragment markup.protected MarkupContainer
getMarkupProvider(Component component)
Returns markup provider associated with this fragmentvoid
onComponentTagBody(Component component, MarkupStream markupStream, ComponentTag openTag)
Skip the body markup associated with the 'component'.-
Methods inherited from class org.apache.wicket.markup.html.panel.AbstractMarkupSourcingStrategy
onComponentTag, renderHead, searchInNestedTransparentResolvers, searchMarkupInTransparentResolvers
-
-
-
-
Constructor Detail
-
FragmentMarkupSourcingStrategy
public FragmentMarkupSourcingStrategy(String markupId, MarkupContainer markupProvider)
Constructor.- Parameters:
markupId
- The associated id of the associated markup fragmentmarkupProvider
- The component whose markup contains the fragment's markup
-
-
Method Detail
-
onComponentTagBody
public void onComponentTagBody(Component component, MarkupStream markupStream, ComponentTag openTag)
Skip the body markup associated with the 'component'. The body markup is expected to be raw markup only, not containing an wicket component. The body markup may serve documentary purposes for the developer / designer.Than search for the markup of the fragment, effectively replacing the original markup.
- Specified by:
onComponentTagBody
in interfaceIMarkupSourcingStrategy
- Overrides:
onComponentTagBody
in classAbstractMarkupSourcingStrategy
- Parameters:
component
- The component calling the strategy- See Also:
Component.onComponentTagBody(MarkupStream, ComponentTag)
-
getMarkupProvider
protected final MarkupContainer getMarkupProvider(Component component)
Returns markup provider associated with this fragment- Parameters:
component
-- Returns:
- markup provider
-
chooseMarkup
public IMarkupFragment chooseMarkup(Component component)
Get the markup stream which shall be used to search for the fragment- Parameters:
component
-- Returns:
- The markup stream to be used to find the fragment markup
-
getMarkup
public IMarkupFragment getMarkup(MarkupContainer container, Component child)
Search for the child's markup in the fragment markup.- Specified by:
getMarkup
in interfaceIMarkupSourcingStrategy
- Specified by:
getMarkup
in classAbstractMarkupSourcingStrategy
- 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)
-
-