public void encodeEnd(final FacesContext facesContext, final UIComponent component) throws IOException {
final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
final AbstractUIImage image = (AbstractUIImage) component;
final String value = image.getUrl();
String src = value;
if (src != null) {
if (ResourceManagerUtils.isAbsoluteResource(src)) {
// absolute Path to image : nothing to do
} else {
src = null;
if (isDisabled(image)) {
src = ResourceManagerUtils.getImageWithPath(facesContext,
HtmlRendererUtils.createSrc(value, "Disabled"), true);
}
if (src == null) {
src = ResourceManagerUtils.getImageWithPath(facesContext, value);
}
}
}
String border = (String) image.getAttributes().get(Attributes.BORDER);
if (border == null) {
border = "0";
}
String alt = (String) image.getAttributes().get(Attributes.ALT);
if (alt == null) {
alt = "";
}
writer.startElement(HtmlElements.IMG, image);
final String clientId = image.getClientId(facesContext);
writer.writeIdAttribute(clientId);
HtmlRendererUtils.writeDataAttributes(facesContext, writer, image);
if (src != null) {
writer.writeAttribute(HtmlAttributes.SRC, src, true);
}