Subversion Repositories eFlore/Applications.del

Rev

Rev 1162 | Rev 1239 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1151 aurelien 1
package org.tela_botanica.del.client.composants.motsclesimages;
2
 
1165 aurelien 3
import java.util.Iterator;
4
import java.util.List;
5
 
6
import org.tela_botanica.del.client.utils.StringUtils;
7
 
1151 aurelien 8
import com.google.gwt.core.client.GWT;
9
import com.google.gwt.uibinder.client.UiBinder;
10
import com.google.gwt.uibinder.client.UiField;
11
import com.google.gwt.user.client.ui.Composite;
1165 aurelien 12
import com.google.gwt.user.client.ui.HTML;
1151 aurelien 13
import com.google.gwt.user.client.ui.HasWidgets;
1165 aurelien 14
import com.google.gwt.user.client.ui.InlineHTML;
1151 aurelien 15
import com.google.gwt.user.client.ui.Panel;
16
import com.google.gwt.user.client.ui.Widget;
17
 
18
public class MotsClesImageVue extends Composite  implements MotsClesImagePresenteur.Vue {
19
 
20
	@UiField
1162 aurelien 21
	public Panel motsCles;
1151 aurelien 22
 
23
	@UiField
1165 aurelien 24
	public Panel motsClesCel;
25
 
26
	@UiField
1151 aurelien 27
	public Panel saisieMotsCles;
28
 
29
	interface MyUiBinder extends UiBinder<Widget, MotsClesImageVue> {
30
 
31
	}
32
 
33
	private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);
34
 
35
	public MotsClesImageVue() {
36
		// sets listBox
37
		initWidget(uiBinder.createAndBindUi(this));
38
	}
1162 aurelien 39
 
40
	@Override
41
	public void viderZoneMotsCles() {
42
		motsCles.clear();
43
	}
1151 aurelien 44
 
45
	@Override
1162 aurelien 46
	public HasWidgets getZoneMotsCles() {
47
		return motsCles;
1151 aurelien 48
	}
49
 
50
	@Override
1165 aurelien 51
	public HasWidgets getZoneMotsClesCel() {
52
		return motsClesCel;
53
	}
54
 
55
	@Override
1151 aurelien 56
	public HasWidgets getZoneSaisieMotsCles() {
57
		return saisieMotsCles;
58
	}
1165 aurelien 59
 
60
	@Override
61
	public void afficherMotsClesCel(List<String> motsClesCelImages, List<String> motsClesCelAFiltrer) {
62
		for (Iterator<String> iterator = motsClesCelImages.iterator(); iterator
63
				.hasNext();) {
64
			String mot = (String) iterator.next();
65
			String motNormalise = StringUtils.normaliser(mot);
66
			if(!mot.trim().isEmpty() && motsClesCelAFiltrer.contains(StringUtils.normaliser(motNormalise))) {
67
				HTML motCle = new InlineHTML(mot);
68
				motCle.setStyleName("motCleCel");
69
				motsClesCel.add(motCle);
70
			}
71
		}
72
	}
1151 aurelien 73
}