1
2
3
4
5
6
7
8
9
10
11
12
13
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 public abstract class IdableSuggestOracle extends SuggestOracle{
24 public static class IdableSuggestion implements Suggestion{
25 private String id;
26 private String displayString;
27 private String replacementString;
28 private Map<String, String> attrMap = new HashMap<String, String>();
29
30
31 public IdableSuggestion(){}
32
33 public IdableSuggestion(String id, String displayString, String replacementString) {
34 this.displayString = displayString;
35 this.id = id;
36 this.replacementString = replacementString;
37 }
38
39 public String getId() {
40 return id;
41 }
42
43 @Override
44 public String getDisplayString() {
45 return displayString;
46 }
47
48 @Override
49 public String getReplacementString() {
50 return replacementString;
51 }
52
53 public void setId(String id) {
54 this.id = id;
55 }
56
57 public void setDisplayString(String displayString) {
58 this.displayString = displayString;
59 }
60
61 public void setReplacementString(String replacementString) {
62 this.replacementString = replacementString;
63 }
64
65 protected void addAttr(String key, String value){
66 attrMap.put(key, value);
67 }
68
69
70
71
72
73 public Map<String, String> getAttrMap(){
74 return attrMap;
75 }
76
77 public void setAttrMap(Map<String, String> attrMap){
78 this.attrMap = attrMap;
79 }
80
81
82
83
84
85
86 }
87
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 }