Subversion Repositories eFlore/Applications.del

Rev

Rev 1885 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1885 Rev 1886
Line 13... Line 13...
13
 * @author mathias
13
 * @author mathias
14
 */
14
 */
15
public class TBSuggestOracle extends SuggestOracle {
15
public class TBSuggestOracle extends SuggestOracle {
Line 16... Line 16...
16
 
16
 
17
	// On devrait gérer des objets qui contiennent le nn plutôt que de se baser uniquement sur des Strings
17
	// On devrait gérer des objets qui contiennent le nn plutôt que de se baser uniquement sur des Strings
Line 18... Line 18...
18
	protected ArrayList<String> possibilites;
18
	protected ArrayList<InfosNomPourAutocompletion> possibilites;
19
 
19
 
20
	public TBSuggestOracle() {
20
	public TBSuggestOracle() {
Line 21... Line 21...
21
		this.possibilites = new ArrayList<String>();
21
		this.possibilites = new ArrayList<InfosNomPourAutocompletion>();
22
	}
22
	}
23
 
23
 
Line 24... Line 24...
24
	public void clear() {
24
	public void clear() {
25
		this.possibilites.clear();
25
		this.possibilites.clear();
26
	}
26
	}
Line 27... Line 27...
27
 
27
 
28
	public void add(String suggestion) {
28
	public void add(InfosNomPourAutocompletion suggestion) {
29
		this.possibilites.add(suggestion);
29
		this.possibilites.add(suggestion);
30
	}
30
	}
Line -... Line 31...
-
 
31
 
31
 
32
	public void requestSuggestions(Request request, Callback callback) {
32
	public void requestSuggestions(Request request, Callback callback) {
33
		String query = request.getQuery().toLowerCase();
-
 
34
		int limit = request.getLimit();
-
 
35
		List<MultiWordSuggestion> retenus = new ArrayList<MultiWordSuggestion>();
-
 
36
 
33
		String query = request.getQuery().toLowerCase();
37
		for (InfosNomPourAutocompletion possibilite : this.possibilites) {
34
		int limit = request.getLimit();
38
			String possibiliteTexte = possibilite.getNs();
35
		List<MultiWordSuggestion> retenus = new ArrayList<MultiWordSuggestion>();
39
			String possibiliteHtml = possibiliteTexte;
36
 
40
			if (possibilite.isRetenu()) {
37
		for (String possibilite : this.possibilites) {
41
				possibiliteHtml = "<strong>" + possibiliteHtml + "</strong>";
Line 38... Line 42...
38
			String possibiliteHtml = possibilite;
42
			}