protected void encodeHtmlCommandButtonEnd(FacesContext context,
HtmlCommandButton htmlCommandButton) throws IOException {
ResponseWriter writer = context.getResponseWriter();
writer.startElement(JsfConstants.INPUT_ELEM, htmlCommandButton);
final String image = getImage(context, htmlCommandButton);
final boolean isImageType = StringUtil.isNotBlank(image);
String type;
if (isImageType) {
type = JsfConstants.IMAGE_VALUE;
} else {
type = htmlCommandButton.getType();
}
RendererUtil.renderAttribute(writer, JsfConstants.TYPE_ATTR, type);
final String id = getIdForRender(context, htmlCommandButton);
RendererUtil
.renderIdAttributeIfNecessary(writer, htmlCommandButton, id);
RendererUtil.renderAttribute(writer, JsfConstants.NAME_ATTR,
htmlCommandButton.getClientId(context));
if (isImageType) {
RendererUtil.renderAttribute(writer, JsfConstants.SRC_ATTR, image,
JsfConstants.IMAGE_ATTR);
} else {
renderValueAttribute(context, htmlCommandButton, writer);
}
renderRemainAttributes(htmlCommandButton, writer, ignoreComponent);
writer.endElement(JsfConstants.INPUT_ELEM);
}