if (!pure) {
headerHeight = headerHeight.subtract(6); // XXX todo
}
headerStyle.setHeight(headerHeight);
writer.writeStyleAttribute(headerStyle);
final AbstractUIColumn column = renderedColumnList.get(j);
String sorterImage = null;
Markup markup = Markup.NULL;
String tip = (String) column.getAttributes().get(Attributes.TIP);
if (cell.getColumnSpan() == 1) {
final boolean sortable = ComponentUtils.getBooleanAttribute(column, Attributes.SORTABLE);
if (sortable) {
UICommand sortCommand = (UICommand) column.getFacet(Facets.SORTER);
if (sortCommand == null) {
final String columnId = column.getClientId(facesContext);
final String sorterId = columnId.substring(columnId.lastIndexOf(":") + 1) + "_" + UISheet.SORTER_ID;
sortCommand = (UICommand) CreateComponentUtils.createComponent(
facesContext, UICommand.COMPONENT_TYPE, RendererTypes.LINK, sorterId);
column.getFacets().put(Facets.SORTER, sortCommand);
}
final CommandMap map = new CommandMap();
final Command click = new Command(sortCommand.getClientId(facesContext),
null, null, null, new String[]{sheet.getClientId(facesContext)}, null, null, null, null, null);
map.setClick(click);
writer.writeAttribute(DataAttributes.COMMANDS, JsonUtils.encode(map), true);
if (tip == null) {
tip = "";
} else {
tip += " - ";
}
tip += ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "sheetTipSorting");
markup = markup.add(Markup.SORTABLE);
final SheetState sheetState = sheet.getSheetState(facesContext);
if (column.getId().equals(sheetState.getSortedColumnId())) {
final String sortTitle;
if (sheetState.isAscending()) {
sorterImage = contextPath + resourceManager.getImage(facesContext, "image/ascending.gif");
sortTitle = ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "sheetAscending");
markup = markup.add(Markup.ASCENDING);