/** * Get the markup stream which shall be used to search for the fragment * * @param component * @return The markup stream to be used to find the fragment markup */ public IMarkupFragment chooseMarkup(final Component component) { return getMarkupProvider(component).getMarkup(null); }
IMarkupFragment markup = chooseMarkup(container); if (markup == null) MarkupContainer markupProvider = getMarkupProvider(container); Markup associatedMarkup = markupProvider.getAssociatedMarkup(); if (associatedMarkup != null) " in providing markup container " + getMarkupProvider(container)); + "' in providing markup container " + getMarkupProvider(container) + " is not a <wicket:fragment> tag");
/** * Skip the body markup associated with the 'component'. The body markup is expected to be raw * markup only, not containing an wicket component. The body markup may serve documentary * purposes for the developer / designer. * <p> * Than search for the markup of the fragment, effectively replacing the original markup. */ @Override public void onComponentTagBody(final Component component, final MarkupStream markupStream, final ComponentTag openTag) { // Skip the body markup making sure it contains only raw markup super.onComponentTagBody(component, markupStream, openTag); // Get the fragments open tag MarkupStream stream = new MarkupStream(getMarkup((MarkupContainer)component, null)); ComponentTag fragmentOpenTag = stream.getTag(); // if it is an open close tag, skip this fragment. if (!fragmentOpenTag.isOpenClose()) { // We'll completely ignore the fragments open tag. It'll not be rendered stream.next(); // Render the body of the fragment component.onComponentTagBody(stream, fragmentOpenTag); } }
IMarkupFragment markup = chooseMarkup(container); if (markup == null) MarkupContainer markupProvider = getMarkupProvider(container); Markup associatedMarkup = markupProvider.getAssociatedMarkup(); if (associatedMarkup != null) " in providing markup container " + getMarkupProvider(container)); + "' in providing markup container " + getMarkupProvider(container) + " is not a <wicket:fragment> tag");
/** * Skip the body markup associated with the 'component'. The body markup is expected to be raw * markup only, not containing an wicket component. The body markup may serve documentary * purposes for the developer / designer. * <p> * Than search for the markup of the fragment, effectively replacing the original markup. */ @Override public void onComponentTagBody(final Component component, final MarkupStream markupStream, final ComponentTag openTag) { // Skip the body markup making sure it contains only raw markup super.onComponentTagBody(component, markupStream, openTag); // Get the fragments open tag MarkupStream stream = new MarkupStream(getMarkup((MarkupContainer)component, null)); ComponentTag fragmentOpenTag = stream.getTag(); // if it is an open close tag, skip this fragment. if (!fragmentOpenTag.isOpenClose()) { // We'll completely ignore the fragments open tag. It'll not be rendered stream.next(); // Render the body of the fragment component.onComponentTagBody(stream, fragmentOpenTag); } }
/** * Get the markup stream which shall be used to search for the fragment * * @param component * @return The markup stream to be used to find the fragment markup */ public IMarkupFragment chooseMarkup(final Component component) { return getMarkupProvider(component).getMarkup(null); }