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 | 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 | |
|
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 | |
|
70 | |
|
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 | |
|
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 | |
} |