createHeaderAndBodyStyles(facesContext, component, true);
createHeaderAndBodyStyles(facesContext, component, false);
}
public static void createHeaderAndBodyStyles(FacesContext facesContext, UIComponent component, boolean width) {
RendererBase renderer = ComponentUtil.getRenderer(facesContext, component);
HtmlStyleMap style = (HtmlStyleMap) component.getAttributes().get(ATTR_STYLE);
Integer styleSpace = null;
try {
styleSpace = style.getInt(width ? "width" : "height");
} catch (Exception e) {
/* ignore */
}
if (styleSpace != null) {
int bodySpace = 0;
int headerSpace = 0;
if (!width) {
if (renderer != null) {
headerSpace = renderer.getHeaderHeight(facesContext, component);
}
bodySpace = styleSpace - headerSpace;
}
HtmlStyleMap headerStyle = ensureStyleAttributeMap(component, ATTR_STYLE_HEADER);
HtmlStyleMap bodyStyle = ensureStyleAttributeMap(component, ATTR_STYLE_BODY);