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, FragmentMarkupSourcingStrategy

public abstract class AbstractMarkupSourcingStrategy
extends Object
implements IMarkupSourcingStrategy

Implements boiler plate as needed by most markup sourcing strategies.

Author:
Juergen Donnerstag

Constructor Summary
AbstractMarkupSourcingStrategy()
           
 
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)
          Will replace the respective component's method.
 void renderHead(Component component, HtmlHeaderContainer container)
          Will be called in addition to Component.renderHead(HtmlHeaderContainer) and allows the strategy to contribute to the <head> section of the response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMarkupSourcingStrategy

public AbstractMarkupSourcingStrategy()
Method Detail

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)
Will replace the respective component's method.

It's perfectly valid to call component.onComponentTagBody(markupStream, openTag) from insight this method.

Specified by:
onComponentTagBody in interface IMarkupSourcingStrategy
Parameters:
component - The component calling the strategy
See Also:
Component.onComponentTagBody(MarkupStream, ComponentTag)

getMarkup

public abstract IMarkupFragment getMarkup(MarkupContainer container,
                                          Component child)
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.
child - The componen to find the markup for.
Returns:
markup fragment
See Also:
MarkupContainer.getMarkup(Component)

renderHead

public void renderHead(Component component,
                       HtmlHeaderContainer container)
Will be called in addition to Component.renderHead(HtmlHeaderContainer) and allows the strategy to contribute to the <head> section of the response.

Specified by:
renderHead in interface IMarkupSourcingStrategy
Parameters:
component - The component calling the strategy
See Also:
Component.renderHead(HtmlHeaderContainer)


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