261 |
aurelien |
1 |
package org.tela_botanica.del.client.composants.formulaires;
|
|
|
2 |
|
|
|
3 |
import com.google.gwt.user.client.ui.LayoutPanel;
|
|
|
4 |
import com.google.gwt.user.client.ui.MultiWordSuggestOracle;
|
|
|
5 |
import com.google.gwt.user.client.ui.SuggestBox;
|
|
|
6 |
import com.google.gwt.user.client.ui.SuggestOracle;
|
|
|
7 |
|
|
|
8 |
public class AutoCompletionComboBoxVue extends LayoutPanel {
|
|
|
9 |
|
|
|
10 |
MultiWordSuggestOracle msu = new MultiWordSuggestOracle();
|
|
|
11 |
SuggestBox suggestions = new SuggestBox(msu);
|
|
|
12 |
|
|
|
13 |
|
|
|
14 |
public AutoCompletionComboBoxVue() {
|
|
|
15 |
add(suggestions);
|
386 |
aurelien |
16 |
//TODO: voir avec greg si la taille doit être définie ici
|
|
|
17 |
setHeight("25px");
|
261 |
aurelien |
18 |
setWidth("100%");
|
|
|
19 |
}
|
|
|
20 |
|
|
|
21 |
public SuggestBox getSuggestBox() {
|
|
|
22 |
return suggestions;
|
|
|
23 |
}
|
|
|
24 |
|
|
|
25 |
public void remplirListe(String[] listePropositions) {
|
|
|
26 |
|
|
|
27 |
msu.clear();
|
|
|
28 |
for (int i = 0; i < listePropositions.length; i++) {
|
|
|
29 |
msu.add(listePropositions[i]);
|
|
|
30 |
}
|
|
|
31 |
}
|
|
|
32 |
|
|
|
33 |
public void afficherSuggestions(SuggestOracle.Request requeteOracle, SuggestOracle.Callback callBackOracle) {
|
|
|
34 |
msu.requestSuggestions(requeteOracle, callBackOracle);
|
|
|
35 |
}
|
|
|
36 |
}
|