* {@inheritDoc}
*/
@Override
public IMarkupFragment getMarkup(final MarkupContainer parent, final Component child)
{
IMarkupFragment markup = parent.getAssociatedMarkup();
if (markup == null)
{
throw new MarkupNotFoundException("Failed to find markup file associated. " +
parent.getClass().getSimpleName() + ": " + parent.toString());
}
// Find <wicket:panel>
IMarkupFragment panelMarkup = findPanelTag(markup);
if (panelMarkup == null)
{
throw new MarkupNotFoundException(
"Expected to find <wicket:panel> in associated markup file. Markup: " +
markup.toString());
}
// If child == null, than return the markup fragment starting with <wicket:panel>
if (child == null)
{
return panelMarkup;
}
// Find the markup for the child component
markup = panelMarkup.find(child.getId());
if ((child == null) || (markup != null))
{
return markup;
}