if (null == widgetModule) {
// Do fallback if widget is not supported by the protocol
return doFallbackOpen(context, attributes);
}
TabsRenderer tabsRenderer = widgetModule.getTabsRenderer();
if (null == tabsRenderer){
// Do fallback if widget is not supported by the protocol
return doFallbackOpen(context, attributes);
}
// Send page context to the renderer via attributes.
// This is necessary to switch page buffers for contents/labels
// in the renderer.
((TabsAttributes)protocolAttributes)
.setPageContext(getPageContext(context));
tabsRenderer.renderOpen(
getProtocol(context),
(WidgetAttributes)protocolAttributes);
MarinerPageContext pageContext = getPageContext(context);
//create anonymous layout for tab's contents
contentsRegionInstance = createAnonymousRegion(pageContext);
//create anonymous layout for tab's labels
labelsRegionInstance = createAnonymousRegion(pageContext);
//set created anonymous layouts in tabs renderer
tabsRenderer.setContentsRegionInstance(contentsRegionInstance);
tabsRenderer.setLabelsRegionInstance(labelsRegionInstance);
// Open tabs elemen
tabsRenderer.renderTabsOpen(
getProtocol(context), (WidgetAttributes)protocolAttributes);
if (!tabsRenderer.shouldRenderContents(getProtocol(context),
(WidgetAttributes)protocolAttributes)) {
return XDIMEResult.SKIP_ELEMENT_BODY;
}
} catch (ProtocolException e) {
logger.error("rendering-error", getTagName(), e);