org.apache.wicket.markup.html.panel
Class FragmentMarkupSourcingStrategy

java.lang.Object
  extended by org.apache.wicket.markup.html.panel.AbstractMarkupSourcingStrategy
      extended by 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
FragmentMarkupSourcingStrategy(java.lang.String markupId, MarkupContainer markupProvider)
          Constructor.
 
Method Summary
 IMarkupFragment chooseMarkup(Component component)
          Get the markup stream which shall be used to search for the fragment
 IMarkupFragment 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 fragment
 void 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, searchMarkupInTransparentResolvers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FragmentMarkupSourcingStrategy

public FragmentMarkupSourcingStrategy(java.lang.String markupId,
                                      MarkupContainer markupProvider)
Constructor.

Parameters:
markupId - The associated id of the associated markup fragment
markupProvider - 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 interface IMarkupSourcingStrategy
Overrides:
onComponentTagBody in class AbstractMarkupSourcingStrategy
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 interface IMarkupSourcingStrategy
Specified by:
getMarkup in class AbstractMarkupSourcingStrategy
Parameters:
container - The parent containing the child. This is not the direct parent, transparent component resolver 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)


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.