Subversion Repositories eFlore/Applications.del

Rev

Rev 1151 | Rev 1162 | 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
 
3
import java.util.List;
4
 
5
import com.google.gwt.core.client.GWT;
6
import com.google.gwt.uibinder.client.UiBinder;
7
import com.google.gwt.uibinder.client.UiField;
8
import com.google.gwt.user.client.ui.Composite;
1152 aurelien 9
import com.google.gwt.user.client.ui.HTML;
1151 aurelien 10
import com.google.gwt.user.client.ui.HasWidgets;
11
import com.google.gwt.user.client.ui.Label;
12
import com.google.gwt.user.client.ui.Panel;
13
import com.google.gwt.user.client.ui.Widget;
14
 
15
public class MotsClesImageVue extends Composite  implements MotsClesImagePresenteur.Vue {
16
 
17
	@UiField
1152 aurelien 18
	public HTML motsCles;
1151 aurelien 19
 
20
	@UiField
21
	public Panel saisieMotsCles;
22
 
23
	interface MyUiBinder extends UiBinder<Widget, MotsClesImageVue> {
24
 
25
	}
26
 
27
	private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);
28
 
29
	public MotsClesImageVue() {
30
		// sets listBox
31
		initWidget(uiBinder.createAndBindUi(this));
32
	}
33
 
34
	@Override
35
	public void afficherMotsCles(List<String> listeMotsCles) {
36
		String chaine = "";
1152 aurelien 37
		Object[] tabMotsCles = listeMotsCles.toArray();
38
		int nbMc = tabMotsCles.length;
39
		for (int i = 0; i < tabMotsCles.length; i++) {
40
			String string = (String)tabMotsCles[i];
41
			chaine += "<span class=\"motCleImage\">"+string+"</span>";
42
			chaine += (i != (nbMc - 1)) ? " " : "";
1151 aurelien 43
		}
1152 aurelien 44
		motsCles.setHTML(chaine);
1151 aurelien 45
	}
46
 
47
	@Override
48
	public HasWidgets getZoneSaisieMotsCles() {
49
		return saisieMotsCles;
50
	}
51
}