public static 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>