Integer colSpan = _getColSpan(context, node, rowSpan);
//
// If we have a header node, render it
//
UINode headerNode = getNamedChild(context, node, TOP_CHILD);
if (headerNode != null)
{
writer.startElement("tr", null);
renderMargin(context, node, null);
writer.startElement("td", null);
writer.writeAttribute("colspan", colSpan, null);
renderNamedChild(context, node, headerNode, TOP_CHILD);
writer.endElement("td");
renderMargin(context, node, null);
writer.endElement("tr");
}
//
// Begin rendering the content row
//
writer.startElement("tr", null);
renderMargin(context, node, rowSpan);
//
// Render the left hand side
//
String leftName = _getSideNode(context, node, true);
UINode leftNode = getNamedChild(context, node, leftName);
renderLeftSideNode(context, node, leftName, leftNode, rowSpan, colSpan);
//
// Render the inner left side node, if any
//
String innerleftName = _getInnerSideNode(context, node, true);
UINode innerLeftNode = getNamedChild(context, node, innerleftName);
if (innerLeftNode != null)
{
renderSideNode(context, node, innerLeftNode,
innerleftName, rowSpan, null);
}
//
// Render the child on the inside top of the layout
//
boolean isRightSideRendered =
_renderMiddleNode(context, node, INNER_TOP_CHILD, rowSpan,
false, true);
// render the content
if (node.getIndexedChildCount(context) > 0)
{
/* if the right hand side has been rendered then we need to start a new
row. otherwise, we can still render on to the previous row. */
if (isRightSideRendered)
{
writer.startElement("tr", null);
}
writer.startElement("td", null);
writer.writeAttribute("width", "100%", null);
writer.writeAttribute("valign", "top", null);
super.renderContent(context, node);
writer.endElement("td");
/* if the right hand side nodes have not been rendered, then render them
here */
if (!isRightSideRendered)
{
_renderRightNodes(context, node, rowSpan);
isRightSideRendered = true;
}
writer.endElement("tr");
}
/* render the inner bottom child. start a new TR only if the
right side nodes have been rendered, and render the
right side nodes if they have not been rendered. */
isRightSideRendered |=
_renderMiddleNode(context, node, INNER_BOTTOM_CHILD, rowSpan,
isRightSideRendered,
!isRightSideRendered);
/* if a right hand side still has not been rendered then we need
to render it here */
if (!isRightSideRendered)
{
_renderRightNodes(context, node, rowSpan);
writer.endElement("tr");
}
//
// render the footer node
//
UINode footerNode = getNamedChild(context, node, BOTTOM_CHILD);
if (footerNode != null)
{
writer.startElement("tr", null);
renderMargin(context, node, null);