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

java.lang.Object
  extended by org.apache.wicket.markup.html.panel.AbstractMarkupSourcingStrategy
      extended by org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy
All Implemented Interfaces:
IMarkupSourcingStrategy
Direct Known Subclasses:
BorderMarkupSourcingStrategy, PanelMarkupSourcingStrategy

public abstract class AssociatedMarkupSourcingStrategy
extends AbstractMarkupSourcingStrategy

Boilerplate for a markup sourcing strategy which retrieves the markup from associated markup files.

Author:
Juergen Donnerstag

Constructor Summary
AssociatedMarkupSourcingStrategy(java.lang.String tagName)
          Constructor.
 
Method Summary
 IMarkupFragment findMarkupInAssociatedFileHeader(MarkupContainer container, Component child)
          Search the child's markup in the header section of the markup
 IMarkupFragment getMarkup(MarkupContainer parent, Component child)
          Search for the child's markup in the associated markup file.
 void onComponentTag(Component component, ComponentTag tag)
          Make sure we open up open-close tags to open-body-close
protected  void renderAssociatedMarkup(Component component)
          Render the associated markup markup
 void renderHead(Component component, HtmlHeaderContainer container)
          Render the header from the associated markup file
 void renderHeadFromAssociatedMarkupFile(WebMarkupContainer container, HtmlHeaderContainer htmlContainer)
          Called by components like Panel and Border which have associated Markup and which may have a <wicket:head> tag.
 
Methods inherited from class org.apache.wicket.markup.html.panel.AbstractMarkupSourcingStrategy
onComponentTagBody, searchMarkupInTransparentResolvers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssociatedMarkupSourcingStrategy

public AssociatedMarkupSourcingStrategy(java.lang.String tagName)
Constructor.

Parameters:
tagName - Either "panel" or "border"
Method Detail

onComponentTag

public void onComponentTag(Component component,
                           ComponentTag tag)
Description copied from class: AbstractMarkupSourcingStrategy
Make sure we open up open-close tags to open-body-close

Specified by:
onComponentTag in interface IMarkupSourcingStrategy
Overrides:
onComponentTag in class AbstractMarkupSourcingStrategy
Parameters:
component - The component calling the strategy
See Also:
Component.onComponentTag(ComponentTag)

renderAssociatedMarkup

protected final void renderAssociatedMarkup(Component component)
Render the associated markup markup

Parameters:
component -

getMarkup

public IMarkupFragment getMarkup(MarkupContainer parent,
                                 Component child)
Search for the child's markup in the associated markup file.

Specified by:
getMarkup in interface IMarkupSourcingStrategy
Specified by:
getMarkup in class AbstractMarkupSourcingStrategy
Parameters:
parent - The container expected to contain the markup for child
child - The child component to find the markup for
Returns:
The markup associated with the child
See Also:
MarkupContainer.getMarkup(Component)

findMarkupInAssociatedFileHeader

public IMarkupFragment findMarkupInAssociatedFileHeader(MarkupContainer container,
                                                        Component child)
Search the child's markup in the header section of the markup

Parameters:
container -
child -
Returns:
Null, if not found

renderHead

public void renderHead(Component component,
                       HtmlHeaderContainer container)
Render the header from the associated markup file

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

renderHeadFromAssociatedMarkupFile

public final void renderHeadFromAssociatedMarkupFile(WebMarkupContainer container,
                                                     HtmlHeaderContainer htmlContainer)
Called by components like Panel and Border which have associated Markup and which may have a <wicket:head> tag.

Whereas 'this' might be a Panel or Border, the HtmlHeaderContainer parameter has been added to the Page as a container for all headers any of its components might wish to contribute to.

The headers contributed are rendered in the standard way.

Parameters:
container -
htmlContainer - The HtmlHeaderContainer added to the Page


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