protected void renderColumnHeader(FacesContext facesContext,
TobagoResponseWriter writer, UIData component,
int columnIndex, UIColumn column, String imageAscending, String imageDescending, String imageUnsorted,
String image1x1, int sortMarkerWidth, boolean headerResizer) throws IOException {
String sheetId = component.getClientId(facesContext);
Application application = facesContext.getApplication();
List columnWidths = (List) component.getWidthList();
String divWidth = "width: " + columnWidths.get(columnIndex) + "px;";
writer.startElement(HtmlConstants.DIV, null);
writer.writeIdAttribute(sheetId + "_header_box_" + columnIndex);
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 = null;
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);
}