Subversion Repositories eFlore/Applications.del

Rev

Rev 1102 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1102 gduche 1
package org.tela_botanica.del.client.composants.votes.details;
2
 
3
import org.tela_botanica.del.client.composants.presenteur.Presenteur;
4
import org.tela_botanica.del.client.i18n.I18n;
5
import org.tela_botanica.del.client.modeles.VoteDetermination;
6
 
7
import com.google.gwt.i18n.client.DateTimeFormat;
8
import com.google.gwt.user.client.ui.HasWidgets;
9
import com.google.gwt.user.client.ui.IsWidget;
10
 
11
public class LigneVotePresenteur extends Presenteur {
12
 
13
	public interface Vue extends IsWidget {
14
		public void setAuteur(String auteur);
15
		public void setColonneDateEtNb(String date);
16
	}
17
 
18
	private Vue vue;
19
	private VoteDetermination vote;
20
 
21
	public LigneVotePresenteur(Vue vue, VoteDetermination vote) {
22
		this.vue = vue;
23
		this.vote = vote;
24
		afficherProposition();
25
	}
26
 
27
	//Pour les votes anonymes
28
	public LigneVotePresenteur(Vue vue, int nbVotes) {
29
		this.vue = vue;
30
		vue.setAuteur(I18n.getMessages().etVotesAnonymes(String.valueOf(nbVotes)));
31
 
32
	}
33
 
34
 
35
	public void afficherProposition() {
36
		vue.setAuteur(vote.getAuteur().getNomComplet());
37
		vue.setColonneDateEtNb(DateTimeFormat.getFormat("dd/MM/yyyy").format(vote.getDate()));
38
	}
39
 
40
	/**
41
	 * Declenchement du présenteur
42
	 */
43
	public void go(HasWidgets container) {
44
		container.add(vue.asWidget());
45
		gererEvenements();
46
	}
47
 
48
 
49
	protected void gererEvenements() {
50
 
51
	}
52
 
53
}
54
 
55
 
56