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

java.lang.Object
  extended by 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
AbstractMarkupSourcingStrategy()
          Construct.
 
Method Summary
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-close
 void 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 searchMarkupInTransparentResolvers(MarkupContainer container, Component child)
          If the child has not been directly added to the container, but via a TransparentWebMarkupContainer, then we are in trouble.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 interface IMarkupSourcingStrategy
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)

searchMarkupInTransparentResolvers

protected IMarkupFragment searchMarkupInTransparentResolvers(MarkupContainer container,
                                                             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.
child - The component to find the markup for.
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 interface IMarkupSourcingStrategy
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 interface IMarkupSourcingStrategy
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 interface IMarkupSourcingStrategy
Parameters:
component - The component calling the strategy
See Also:
Component.renderHead(HtmlHeaderContainer)


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