use of org.hisp.dhis.dataelement.comparator.DataElementCategoryComboSizeComparator in project dhis2-core by dhis2.
the class LoadFormAction method getDataElementCategoryCombos.
private List<DataElementCategoryCombo> getDataElementCategoryCombos(List<DataElement> dataElements, DataSet dataSet) {
Set<DataElementCategoryCombo> categoryCombos = new HashSet<>();
for (DataElement dataElement : dataElements) {
categoryCombos.add(dataElement.getCategoryCombo(dataSet));
}
List<DataElementCategoryCombo> listCategoryCombos = new ArrayList<>(categoryCombos);
Collections.sort(listCategoryCombos, new DataElementCategoryComboSizeComparator());
return listCategoryCombos;
}
Aggregations