| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.rice.kns.lookup.keyvalues; |
| 17 | |
|
| 18 | |
import java.util.ArrayList; |
| 19 | |
import java.util.Collections; |
| 20 | |
import java.util.List; |
| 21 | |
|
| 22 | |
import org.kuali.rice.core.util.KeyLabelPair; |
| 23 | |
import org.kuali.rice.kns.bo.ParameterType; |
| 24 | |
import org.kuali.rice.kns.service.KNSServiceLocator; |
| 25 | |
import org.kuali.rice.kns.service.KeyValuesService; |
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | 0 | public class ParameterTypeValuesFinder extends KeyValuesBase { |
| 33 | |
|
| 34 | 0 | private static ParameterTypeComparator comparator = new ParameterTypeComparator(); |
| 35 | |
|
| 36 | |
public List<KeyLabelPair> getKeyValues() { |
| 37 | |
|
| 38 | |
|
| 39 | 0 | KeyValuesService boService = KNSServiceLocator.getKeyValuesService(); |
| 40 | 0 | List<ParameterType> bos = (List) boService.findAll(ParameterType.class); |
| 41 | |
|
| 42 | 0 | if ( bos == null ) { |
| 43 | 0 | bos = new ArrayList<ParameterType>(0); |
| 44 | |
} else { |
| 45 | 0 | bos = new ArrayList<ParameterType>( bos ); |
| 46 | |
} |
| 47 | |
|
| 48 | |
|
| 49 | 0 | Collections.sort(bos, comparator); |
| 50 | |
|
| 51 | |
|
| 52 | 0 | List<KeyLabelPair> labels = new ArrayList<KeyLabelPair>( bos.size() ); |
| 53 | |
|
| 54 | 0 | for ( ParameterType bo : bos ) { |
| 55 | 0 | labels.add( new KeyLabelPair(bo.getParameterTypeCode(), bo.getParameterTypeName() ) ); |
| 56 | |
} |
| 57 | |
|
| 58 | 0 | return labels; |
| 59 | |
} |
| 60 | |
} |