}
}
public void encodeEnd(final FacesContext facesContext, final UIComponent component) throws IOException {
final AbstractUIFile file = (AbstractUIFile) component;
final String clientId = file.getClientId(facesContext);
final Style style = new Style(facesContext, file);
final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
writer.startElement(HtmlElements.DIV, file);
writer.writeIdAttribute(clientId);
writer.writeClassAttribute(Classes.create(file));
HtmlRendererUtils.writeDataAttributes(facesContext, writer, file);
writer.writeStyleAttribute(style);
// visible fake input for a pretty look
final Style inputStyle = new Style();
final Measure prettyWidthSub = getResourceManager().getThemeMeasure(facesContext, file, "prettyWidthSub");
inputStyle.setWidth(style.getWidth().subtract(prettyWidthSub));
writer.startElement(HtmlElements.INPUT, file);
writer.writeIdAttribute(clientId + ComponentUtils.SUB_SEPARATOR + "pretty");
writer.writeAttribute(HtmlAttributes.TYPE, HtmlInputTypes.TEXT, false);
writer.writeClassAttribute(Classes.create(file, "pretty"));
writer.writeStyleAttribute(inputStyle);
writer.writeAttribute(HtmlAttributes.DISABLED, true);
// TODO Focus
//HtmlRendererUtils.renderFocus(clientId, file.isFocus(), ComponentUtils.isError(file), facesContext, writer);
writer.endElement(HtmlElements.INPUT);
// invisible file input
writer.startElement(HtmlElements.INPUT, file);
writer.writeIdAttribute(clientId + ComponentUtils.SUB_SEPARATOR + "real");
writer.writeAttribute(HtmlAttributes.TYPE, HtmlInputTypes.FILE, false);
writer.writeClassAttribute(Classes.create(file, "real"));
writer.writeNameAttribute(clientId);
// readonly seems not making sense in browsers.
writer.writeAttribute(HtmlAttributes.DISABLED, file.isDisabled() || file.isReadonly());
writer.writeAttribute(HtmlAttributes.READONLY, file.isReadonly());
writer.writeAttribute(HtmlAttributes.REQUIRED, file.isRequired());
writer.writeAttribute(HtmlAttributes.SIZE, "1024", false);
final Integer tabIndex = file.getTabIndex();
if (tabIndex != null) {
writer.writeAttribute(HtmlAttributes.TABINDEX, tabIndex);
}
final String title = HtmlRendererUtils.getTitleFromTipAndMessages(facesContext, file);
if (title != null) {