}
public void encodeEnd(FacesContext context, ResponseWriter writer,
UIComponent column, String facetName, boolean sortableColumn)
throws IOException {
UIColumn col = (UIColumn) column;
if (sortableColumn) {
String imageUrl = null;
if (Ordering.ASCENDING.equals(col.getSortOrder())) {
if (null != col.getSortIconAscending()) {
imageUrl = col.getSortIconAscending();
} else {
imageUrl = getResource(TriangleIconUp.class.getName())
.getUri(context, null);
}
} else if (Ordering.DESCENDING.equals(col.getSortOrder())) {
if (null != col.getSortIconDescending()) {
imageUrl = col.getSortIconDescending();
} else {
imageUrl = getResource(TriangleIconDown.class.getName())
.getUri(context, null);
}
} else if (col.isSelfSorted()) {
if (null != col.getSortIcon()) {
imageUrl = col.getSortIcon();
} else {
imageUrl = getResource(
DataTableIconSortNone.class.getName()).getUri(
context, null);
}
}
if (imageUrl != null) {
writer.startElement(HTML.IMG_ELEMENT, column);
writer.writeAttribute(HTML.src_ATTRIBUTE, imageUrl, null);
writer.writeAttribute(HTML.width_ATTRIBUTE, "15", null);
writer.writeAttribute(HTML.height_ATTRIBUTE, "15", null);
writer.writeAttribute(HTML.class_ATTRIBUTE,
"extdt-header-sort-img", null);
writer.endElement(HTML.IMG_ELEMENT);
}
writer.endElement(HTML.SPAN_ELEM);
}
writer.endElement(HTML.DIV_ELEM);
if (col.getFilterMethod() == null
&& col.getValueExpression("filterExpression") == null
&& col.getValueExpression("filterBy") != null) {
writer.startElement(HTML.DIV_ELEM, column);
addInplaceInput(context, column);
writer.endElement(HTML.DIV_ELEM);
}