package net.sourceforge.fenixedu.presentationTier.renderers.providers; import java.util.ArrayList; import java.util.Collections; import java.util.List; import net.sourceforge.fenixedu.domain.RootDomainObject; import net.sourceforge.fenixedu.domain.SpecialSituationCode; import net.sourceforge.fenixedu.presentationTier.renderers.converters.DomainObjectKeyConverter; import org.apache.commons.beanutils.BeanComparator; import pt.ist.fenixWebFramework.renderers.DataProvider; import pt.ist.fenixWebFramework.renderers.components.converters.Converter; import com.linkare.commons.metainfo.Linkare; @Linkare(author = "Paulo Zenida") public class SpecialSituationCodesProvider implements DataProvider { public Object provide(Object source, Object currentValue) { final List specialSituationCodes = new ArrayList(RootDomainObject .getInstance().getSpecialSituationCodesSet()); Collections.sort(specialSituationCodes, new BeanComparator("code")); return specialSituationCodes; } public Converter getConverter() { return new DomainObjectKeyConverter(); } }