Coverage Report - org.kuali.student.common.ui.client.widgets.suggestbox.IdableSuggestOracle
 
Classes in this File Line Coverage Branch Coverage Complexity
IdableSuggestOracle
0%
0/2
N/A
1
IdableSuggestOracle$IdableSuggestion
0%
0/21
N/A
1
 
 1  
 /**
 2  
  * Copyright 2010 The Kuali Foundation Licensed under the
 3  
  * Educational Community License, Version 2.0 (the "License"); you may
 4  
  * not use this file except in compliance with the License. You may
 5  
  * obtain a copy of the License at
 6  
  *
 7  
  * http://www.osedu.org/licenses/ECL-2.0
 8  
  *
 9  
  * Unless required by applicable law or agreed to in writing,
 10  
  * software distributed under the License is distributed on an "AS IS"
 11  
  * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 12  
  * or implied. See the License for the specific language governing
 13  
  * permissions and limitations under the License.
 14  
  */
 15  
 
 16  
 package org.kuali.student.common.ui.client.widgets.suggestbox;
 17  
 
 18  
 import java.util.HashMap;
 19  
 import java.util.Map;
 20  
 
 21  
 import com.google.gwt.user.client.ui.SuggestOracle;
 22  
 
 23  0
 public abstract class IdableSuggestOracle extends SuggestOracle{
 24  0
     public static class IdableSuggestion implements Suggestion{
 25  
         private String id;
 26  
         private String displayString;
 27  
         private String replacementString;
 28  0
         private Map<String, String> attrMap = new HashMap<String, String>();
 29  
         //private List<String> attrKeys = new ArrayList<String>();
 30  
         
 31  0
         public IdableSuggestion(){}
 32  
 
 33  0
         public IdableSuggestion(String id, String displayString, String replacementString) {
 34  0
             this.displayString = displayString;
 35  0
             this.id = id;
 36  0
             this.replacementString = replacementString;
 37  0
         }
 38  
 
 39  
         public String getId() {
 40  0
             return id;
 41  
         }
 42  
 
 43  
         @Override
 44  
         public String getDisplayString() {
 45  0
             return displayString;
 46  
         }
 47  
 
 48  
         @Override
 49  
         public String getReplacementString() {
 50  0
             return replacementString;
 51  
         }
 52  
         
 53  
         public void setId(String id) {
 54  0
             this.id = id;
 55  0
         }
 56  
 
 57  
         public void setDisplayString(String displayString) {
 58  0
             this.displayString = displayString;
 59  0
         }
 60  
 
 61  
         public void setReplacementString(String replacementString) {
 62  0
             this.replacementString = replacementString;
 63  0
         }
 64  
 
 65  
         protected void addAttr(String key, String value){
 66  0
             attrMap.put(key, value);
 67  0
         }
 68  
         
 69  
 /*        protected void addAttrKey(String key){
 70  
             attrKeys.add(key);
 71  
         }*/
 72  
         
 73  
         public Map<String, String> getAttrMap(){
 74  0
             return attrMap;
 75  
         }
 76  
 
 77  
         public void setAttrMap(Map<String, String> attrMap){
 78  0
             this.attrMap = attrMap;
 79  0
         }
 80  
 
 81  
 /*        public List<String> getAttrKeys(){
 82  
             return attrKeys;
 83  
         }*/
 84  
         
 85  
         
 86  
     }
 87  
     //public abstract IdableSuggestion getSuggestionById(String id);
 88  
     public abstract IdableSuggestion getSuggestionByText(String text);
 89  
     public abstract void getSuggestionByIdSearch(String id, org.kuali.student.common.ui.client.mvc.Callback<IdableSuggestion> callback);
 90  
     public abstract void addSearchCompletedCallback(org.kuali.student.common.ui.client.mvc.Callback<IdableSuggestion> callback);
 91  
 }