int outerSpace, boolean width) {
int margin = 0;
if (component.getRendererType() != null) {
try {
RendererBase renderer = ComponentUtil.getRenderer(facesContext, component);
if (width) {
margin += renderer.getPaddingWidth(facesContext, component);
margin += renderer.getComponentExtraWidth(facesContext, component);
} else {
margin += renderer.getHeaderHeight(facesContext, component);
margin += renderer.getPaddingHeight(facesContext, component);
margin += renderer.getComponentExtraHeight(facesContext, component);
}
} catch (Exception e) {
if (LOG.isDebugEnabled()) {
LOG.debug("cant find margin", e);
}