Subversion Repositories eFlore/Applications.del

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
166 gduche 1
package org.tela_botanica.del.client.vues.rechercheobservations;
2
 
3
import java.util.Iterator;
4
import java.util.List;
5
 
6
import org.tela_botanica.del.client.composants.presenteur.Presenteur;
7
import org.tela_botanica.del.client.modeles.Observation;
8
 
9
import com.google.gwt.user.client.ui.HasWidgets;
10
 
11
public class ObservationPresenteur extends Presenteur {
12
 
13
	private Observation observation;
14
 
15
	public ObservationPresenteur(Observation observation) {
16
		super(new ObservationVue());
17
		this.observation = observation;
18
		chargerObservation();
19
	}
20
 
21
	public void chargerObservation() {
22
		ObservationVue vue = (ObservationVue) this.getVue();
23
		vue.auteur.setText(observation.getAuteur());
24
		vue.date.setText(observation.getDate());
25
		vue.famille.setText(observation.getFamille());
26
		vue.localite.setText(observation.getLocalite());
27
 
28
		List<String> motsCles = observation.getMotsClefs();
29
		Iterator<String> itMotsCles = motsCles.iterator();
30
		String motsClesChaine = "";
31
		while (itMotsCles.hasNext()) {
32
			String motCle = itMotsCles.next();
33
			motsClesChaine += motCle;
34
			if (itMotsCles.hasNext()) {
35
				motsClesChaine += ", ";
36
			}
37
		}
38
		vue.motsClefs.setText(motsClesChaine);
39
		vue.nomRetenu.setText(observation.getNomRetenu());
40
		vue.numNomenclatural.setText(observation.getNumNomenclatural());
41
 
42
	}
43
 
44
	public void go(HasWidgets composite) {
45
		composite.add(this.getVue());
46
	}
47
 
48
	protected void handleEvents() {
49
		// TODO Auto-generated method stub
50
 
51
	}
52
 
53
}