private void renderColumnHeader(FacesContext facesContext,
TobagoResponseWriter writer, UIData component,
int columnCount, UIColumn column, String ascending, String descending,
String image1x1, int sortMarkerWidth) throws IOException {
String sheetId = component.getClientId(facesContext);
Application application = facesContext.getApplication();
List columnWidths = (List) component.getAttributes().get(ATTR_WIDTH_LIST);
String divWidth = "width: " + columnWidths.get(columnCount) + "px;";
writer.startElement(HtmlConstants.DIV, null);
writer.writeIdAttribute(sheetId + "_header_box_" + columnCount);
writer.writeClassAttribute("tobago-sheet-header-box");
writer.writeAttribute(HtmlAttributes.STYLE, divWidth, false);
String tip = (String) column.getAttributes().get(ATTR_TIP);
if (tip == null) {
tip = "";
}
// ############################################
// ############################################
String sorterImage = null;
String sorterClass = "";
String sortTitle = "";
boolean sortable = ComponentUtil.getBooleanAttribute(column, ATTR_SORTABLE);
if (sortable && !(column instanceof UIColumnSelector)) {
UICommand sortCommand = (UICommand) column.getFacet(UIData.FACET_SORTER);
if (sortCommand == null) {
String columnId = column.getClientId(facesContext);
String sorterId = columnId.substring(columnId.lastIndexOf(":") + 1) + "_" + UIData.SORTER_ID;
sortCommand = (UICommand) application.createComponent(UICommand.COMPONENT_TYPE);
sortCommand.setRendererType(RENDERER_TYPE_LINK);
sortCommand.setId(sorterId);
column.getFacets().put(UIData.FACET_SORTER, sortCommand);
}