LabelWithAccessKey label = new LabelWithAccessKey(button);
width = width.add(RenderUtils.calculateStringWidth(facesContext, button, label.getText()));
Measure padding = getResourceManager().getThemeMeasure(facesContext, button, "paddingWidth");
// left padding, right padding and when an image and an text then a middle padding.
width = width.add(padding.multiply(image && label.getText() != null ? 3 : 2));
return width;
}
}