renderLayout(writer,context, (UILayout) component);
}
public void renderLayout(ResponseWriter writer,FacesContext context, UILayout layout)
throws IOException {
LayoutStructure structure = new LayoutStructure(layout);
structure.calculateWidth();
Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
Object oldLayout = requestMap.get(LAYOUT_STRUCTURE_ATTRIBUTE);
requestMap.put(LAYOUT_STRUCTURE_ATTRIBUTE, structure);
// Detect layout content;
if (null != structure.getTop()) {
structure.getTop().encodeAll(context);
}
if (structure.getColumns() > 0) {
// Reorder panels to fill ordeg left->center->right.
if (null != structure.getLeft()) {
structure.getLeft().encodeAll(context);
}
if (null != structure.getCenter()) {
structure.getCenter().encodeAll(context);
}
if (null != structure.getRight()) {
structure.getRight().encodeAll(context);
}
}
// line separator.
writer.startElement(HTML.DIV_ELEM, layout);
writer.writeAttribute(HTML.style_ATTRIBUTE, "display: block; height: 0;line-height:0px; font-size:0px; clear: both; visibility: hidden;", null);
writer.writeText(".", null);
writer.endElement(HTML.DIV_ELEM);
if (null != structure.getBottom()) {
renderChild(context, structure.getBottom());
}
requestMap.put(LAYOUT_STRUCTURE_ATTRIBUTE, oldLayout);
}