Coverage Report - edu.sampleu.travel.krad.controller.UIfComponentsViewHelperServiceImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
UIfComponentsViewHelperServiceImpl
0%
0/24
N/A
1
 
 1  
 /**
 2  
  * Copyright 2005-2011 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package edu.sampleu.travel.krad.controller;
 17  
 
 18  
 import org.kuali.rice.core.api.uif.RemotableAttributeField;
 19  
 import org.kuali.rice.core.api.uif.RemotableSelect;
 20  
 import org.kuali.rice.core.api.uif.RemotableTextInput;
 21  
 import org.kuali.rice.krad.uif.container.Container;
 22  
 import org.kuali.rice.krad.uif.service.impl.ViewHelperServiceImpl;
 23  
 import org.kuali.rice.krad.uif.view.View;
 24  
 
 25  
 import java.util.ArrayList;
 26  
 import java.util.HashMap;
 27  
 import java.util.List;
 28  
 import java.util.Map;
 29  
 
 30  
 /**
 31  
  * Custom view helper service for demonstration (supports the kitchen sink)
 32  
  *
 33  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 34  
  */
 35  0
 public class UIfComponentsViewHelperServiceImpl extends ViewHelperServiceImpl {
 36  
 
 37  
     public List<RemotableAttributeField> retrieveRemoteFields(View view, Object model, Container container) {
 38  0
         List<RemotableAttributeField> remoteFields = new ArrayList<RemotableAttributeField>();
 39  
 
 40  
         // note this would generally invoke a remote service to get the list of fields
 41  0
         RemotableAttributeField.Builder builder = RemotableAttributeField.Builder.create("remoteField1");
 42  0
         builder.setLongLabel("Remote Field 1");
 43  
 
 44  0
         RemotableTextInput.Builder controlBuilder = RemotableTextInput.Builder.create();
 45  0
         controlBuilder.setSize(30);
 46  0
         builder.setControl(controlBuilder);
 47  0
         remoteFields.add(builder.build());
 48  
 
 49  0
         builder.setName("remoteField2");
 50  0
         builder.setLongLabel("Remote Field 2");
 51  0
         remoteFields.add(builder.build());
 52  
 
 53  0
         controlBuilder.setSize(5);
 54  0
         builder.setName("remoteField3");
 55  0
         builder.setLongLabel("Remote Field 3");
 56  0
         remoteFields.add(builder.build());
 57  
 
 58  0
         Map<String, String> options = new HashMap<String, String>();
 59  0
         options.put("Fruit", "Fruit");
 60  0
         options.put("Vegetables", "Vegetables");
 61  
 
 62  0
         RemotableSelect.Builder selectBuilder = RemotableSelect.Builder.create(options);
 63  0
         builder.setName("remoteField4");
 64  0
         builder.setLongLabel("Remote Field 4");
 65  0
         builder.setControl(selectBuilder);
 66  0
         remoteFields.add(builder.build());
 67  
 
 68  0
         return remoteFields;
 69  
     }
 70  
 
 71  
 }