View Javadoc

1   package org.kuali.ole.editor.keyvalue;
2   
3   
4   import org.kuali.ole.catalog.bo.OleAccessMethod;
5   import org.kuali.rice.core.api.util.ConcreteKeyValue;
6   import org.kuali.rice.core.api.util.KeyValue;
7   import org.kuali.rice.krad.keyvalues.KeyValuesBase;
8   import org.kuali.rice.krad.service.KRADServiceLocator;
9   
10  import java.util.ArrayList;
11  import java.util.Collection;
12  import java.util.List;
13  
14  /**
15   * AdditionalAccessMethodInformation used to render the values for AccessMethod dropdown control.
16   */
17  public class AdditionalAccessMethodInformation extends KeyValuesBase {
18      /**
19       * This method returns the List of  ConcreteKeyValue,
20       * ConcreteKeyValue has two arguments accessMethodCode  and
21       * accessMethodName.
22       * @return  List<KeyValue>
23       */
24      @Override
25      public List<KeyValue> getKeyValues() {
26          List<KeyValue> options = new ArrayList<KeyValue>();
27          Collection<OleAccessMethod> oleAccessMethods =
28                  KRADServiceLocator.getBusinessObjectService().findAll(OleAccessMethod.class);
29          options.add(new ConcreteKeyValue("", ""));
30          for (OleAccessMethod type : oleAccessMethods) {
31              options.add(new ConcreteKeyValue(type.getAccessMethodCode(), type.getAccessMethodName()));
32          }
33          return options;
34      }
35  }