View Javadoc
1   /**
2    * Copyright 2005-2013 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 org.kuali.student.lum.lu.ui.course.keyvalues;
17  
18  import java.util.ArrayList;
19  import java.util.List;
20  
21  import org.kuali.rice.core.api.util.ConcreteKeyValue;
22  import org.kuali.rice.core.api.util.KeyValue;
23  import org.kuali.rice.krad.uif.control.UifKeyValuesFinderBase;
24  import org.kuali.rice.krad.uif.view.ViewModel;
25  
26  /**
27   * 
28   * This is the helper class for CourseView
29   * 
30   * @author OpenCollab/rSmart KRAD CM Conversion Alliance!
31   */
32  
33  public class CourseJointKeyValuesFinder extends UifKeyValuesFinderBase {
34  	
35  	private static final long serialVersionUID = 1394806282459489941L;
36  
37  	public enum SearchByKeys {
38  		COURSES_AND_PROPOSALS("Courses and Proposals"), COURSES_ONLY("Courses Only"), PROPOSALS_ONLY("Proposals Only");
39  		
40  		private String display;
41  		
42  		SearchByKeys(String display) {
43  			this.display = display;
44  		}
45  		
46  		public String getDisplay() {
47  			return display;
48  		}
49  	}
50  
51  	@Override
52  	public List<KeyValue> getKeyValues(ViewModel model) {
53  		final List<KeyValue> keyValues = new ArrayList<KeyValue>();
54  		keyValues.add(new ConcreteKeyValue(SearchByKeys.COURSES_AND_PROPOSALS.toString(), SearchByKeys.COURSES_AND_PROPOSALS.getDisplay()));
55  		keyValues.add(new ConcreteKeyValue(SearchByKeys.COURSES_ONLY.toString(), SearchByKeys.COURSES_ONLY.getDisplay()));
56  		keyValues.add(new ConcreteKeyValue(SearchByKeys.PROPOSALS_ONLY.toString(), SearchByKeys.PROPOSALS_ONLY.getDisplay()));
57          return keyValues;
58  	}
59  
60  }