[]
ISortFieldIconSortFieldAn IIconSortField defines an icon-based sort key for a range and extends ISortField. Use this interface to specify both the IIcon to sort by and the SortOrder applied to that icon criterion.
worksheet.getRange("A1:A4").setValue(new Object[][] {{3}, {1}, {4}, {2}});
IRange keyRange = worksheet.getRange("A1:A4");
keyRange.getFormatConditions().addIconSetCondition().setIconSet(
workbook.getIconSets().get(IconSetType.Icon3TrafficLights1));
IIcon icon = workbook.getIconSets().get(IconSetType.Icon3TrafficLights1).get(0);
IIconSortField sortField = new IconSortField(keyRange, icon, SortOrder.Descending);
ISort sort = worksheet.getSort();
sort.getSortFields().add(sortField);
sort.setRange(keyRange);
sort.apply();
getKey, getPriority, getSortOn, setPriorityReturns the SortOrder that determines whether matching icons are sorted in ascending or descending order.
worksheet.getRange("A1:A4").setValue(new Object[][] {{3}, {1}, {4}, {2}});
IIcon icon = workbook.getIconSets().get(IconSetType.Icon3TrafficLights1).get(0);
IIconSortField sortField = new IconSortField(worksheet.getRange("A1:A4"), icon, SortOrder.Descending);
SortOrder order = sortField.getOrder();
IIcon object used to sort by.Use this method to retrieve the IIcon associated with the current icon sort field.
IIcon icon = workbook.getIconSets().get(IconSetType.Icon3Arrows).get(0);
IIconSortField sortField = new IconSortField(worksheet.getRange("A2:A4"), icon);
IIcon sortIcon = sortField.getIcon();
IIcon object used to sort by.