View Javadoc
1   package org.kuali.ole.select.keyvalue;
2   
3   import org.apache.commons.lang.StringUtils;
4   import org.kuali.ole.select.bo.OLEEResourceChangeDashBoard;
5   import org.kuali.ole.select.form.OLEEResourceChangeDashboardForm;
6   import org.kuali.rice.core.api.util.ConcreteKeyValue;
7   import org.kuali.rice.core.api.util.KeyValue;
8   import org.kuali.rice.krad.uif.control.UifKeyValuesFinderBase;
9   import org.kuali.rice.krad.uif.view.ViewModel;
10  
11  import java.util.ArrayList;
12  import java.util.List;
13  
14  /**
15   * Created by srirams on 23/9/14.
16   */
17  public class OLEOriginKeyValueFinder extends UifKeyValuesFinderBase {
18  
19      @Override
20      public List getKeyValues(ViewModel viewModel) {
21          List<KeyValue> keyValues = new ArrayList<KeyValue>();
22          OLEEResourceChangeDashboardForm acquisitionEResourceChangeDashboardForm = (OLEEResourceChangeDashboardForm) viewModel;
23          List<OLEEResourceChangeDashBoard> OLEEResourceChangeDashBoards = acquisitionEResourceChangeDashboardForm.getOleeResourceChangeDashBoardList();
24          for(OLEEResourceChangeDashBoard changeDashBoard : OLEEResourceChangeDashBoards){
25              String origin = changeDashBoard.getOrigin();
26              if (StringUtils.isNotEmpty(origin))
27                  keyValues.add(new ConcreteKeyValue(origin,origin));
28          }
29          keyValues.add(new ConcreteKeyValue("", ""));
30          return keyValues;
31      }
32  }