2211 |
arthur |
1 |
package org.tela_botanica.del.client.composants.formulaires.formulaireproposition;
|
|
|
2 |
|
|
|
3 |
import java.util.Iterator;
|
|
|
4 |
import java.util.Map;
|
|
|
5 |
|
|
|
6 |
import org.tela_botanica.del.client.i18n.I18n;
|
|
|
7 |
|
|
|
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.Window;
|
|
|
12 |
import com.google.gwt.user.client.ui.Button;
|
|
|
13 |
import com.google.gwt.user.client.ui.Composite;
|
|
|
14 |
import com.google.gwt.user.client.ui.HasText;
|
|
|
15 |
import com.google.gwt.user.client.ui.Label;
|
|
|
16 |
import com.google.gwt.user.client.ui.LayoutPanel;
|
|
|
17 |
import com.google.gwt.user.client.ui.ListBox;
|
|
|
18 |
import com.google.gwt.user.client.ui.TextArea;
|
|
|
19 |
import com.google.gwt.user.client.ui.TextBox;
|
|
|
20 |
import com.google.gwt.user.client.ui.Widget;
|
|
|
21 |
|
|
|
22 |
public class FormulairePropositionVue extends Composite implements FormulairePropositionPresenteur.Vue {
|
|
|
23 |
|
|
|
24 |
@UiField
|
|
|
25 |
public TextBox nom, prenom, courriel;
|
|
|
26 |
|
|
|
27 |
@UiField
|
|
|
28 |
public LayoutPanel propositionTaxon;
|
|
|
29 |
|
|
|
30 |
@UiField
|
|
|
31 |
public TextArea commentaires;
|
|
|
32 |
|
|
|
33 |
@UiField
|
|
|
34 |
public Button boutonValidationProposition;
|
|
|
35 |
|
|
|
36 |
@UiField
|
|
|
37 |
public Label labelnomPrenom;
|
|
|
38 |
|
|
|
39 |
@UiField
|
|
|
40 |
ListBox referentiel;
|
|
|
41 |
|
|
|
42 |
interface FormulairePropositionUIiBinder extends UiBinder<Widget, FormulairePropositionVue> {
|
|
|
43 |
};
|
|
|
44 |
|
|
|
45 |
FormulairePropositionUIiBinder uiBinder = GWT.create(FormulairePropositionUIiBinder.class);
|
|
|
46 |
|
|
|
47 |
public FormulairePropositionVue() {
|
|
|
48 |
initWidget(uiBinder.createAndBindUi(this));
|
|
|
49 |
}
|
|
|
50 |
|
|
|
51 |
|
|
|
52 |
@Override
|
|
|
53 |
public LayoutPanel getPropositionTaxon() {
|
|
|
54 |
return propositionTaxon;
|
|
|
55 |
}
|
|
|
56 |
|
|
|
57 |
@Override
|
|
|
58 |
public TextArea getCommentaires() {
|
|
|
59 |
return commentaires;
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
@Override
|
|
|
63 |
public Button getBoutonValidationProposition() {
|
|
|
64 |
return boutonValidationProposition;
|
|
|
65 |
}
|
|
|
66 |
|
|
|
67 |
@Override
|
|
|
68 |
public void afficherStyleErreurNom(String styleErreur) {
|
|
|
69 |
nom.addStyleName(styleErreur);
|
|
|
70 |
}
|
|
|
71 |
|
|
|
72 |
@Override
|
|
|
73 |
public void supprimerStyleErreurNom(String styleErreur) {
|
|
|
74 |
nom.removeStyleName(styleErreur);
|
|
|
75 |
}
|
|
|
76 |
|
|
|
77 |
@Override
|
|
|
78 |
public void afficherStyleErreurPrenom(String styleErreur) {
|
|
|
79 |
prenom.addStyleName(styleErreur);
|
|
|
80 |
}
|
|
|
81 |
|
|
|
82 |
@Override
|
|
|
83 |
public void supprimerStyleErreurPrenom(String styleErreur) {
|
|
|
84 |
prenom.removeStyleName(styleErreur);
|
|
|
85 |
}
|
|
|
86 |
|
|
|
87 |
@Override
|
|
|
88 |
public void afficherNomPrenomEtDesactiver(String nom, String prenom) {
|
|
|
89 |
this.nom.setText(nom);
|
|
|
90 |
this.prenom.setText(prenom);
|
|
|
91 |
this.nom.setEnabled(false);
|
|
|
92 |
this.prenom.setEnabled(false);
|
|
|
93 |
}
|
|
|
94 |
|
|
|
95 |
@Override
|
|
|
96 |
public void afficherEmailEtDesactiver(String courriel) {
|
|
|
97 |
this.courriel.setText(courriel);
|
|
|
98 |
this.courriel.setEnabled(false);
|
|
|
99 |
}
|
|
|
100 |
public void afficherPropositionDejaEffectuée(String taxon)
|
|
|
101 |
{
|
|
|
102 |
Window.alert(I18n.getMessages().propositionDejaEffectuee(taxon));
|
|
|
103 |
}
|
|
|
104 |
|
|
|
105 |
@Override
|
|
|
106 |
public String getCourriel() {
|
|
|
107 |
return courriel.getText();
|
|
|
108 |
}
|
|
|
109 |
|
|
|
110 |
@Override
|
|
|
111 |
public String getNom() {
|
|
|
112 |
return nom.getText();
|
|
|
113 |
}
|
|
|
114 |
|
|
|
115 |
@Override
|
|
|
116 |
public String getPrenom() {
|
|
|
117 |
return prenom.getText();
|
|
|
118 |
}
|
|
|
119 |
|
|
|
120 |
|
|
|
121 |
@Override
|
|
|
122 |
public HasText getObjetNom() {
|
|
|
123 |
return this.nom;
|
|
|
124 |
}
|
|
|
125 |
|
|
|
126 |
@Override
|
|
|
127 |
public HasText getObjetPrenom() {
|
|
|
128 |
return this.prenom;
|
|
|
129 |
}
|
|
|
130 |
|
|
|
131 |
|
|
|
132 |
@Override
|
|
|
133 |
public HasText getObjetCourriel() {
|
|
|
134 |
return this.courriel;
|
|
|
135 |
}
|
|
|
136 |
|
|
|
137 |
@Override
|
|
|
138 |
public void afficherStyleErreurCourriel(String styleErreur) {
|
|
|
139 |
courriel.setStyleName(styleErreur);
|
|
|
140 |
}
|
|
|
141 |
|
|
|
142 |
@Override
|
|
|
143 |
public void supprimerStyleErreurCourriel(String styleErreur) {
|
|
|
144 |
courriel.removeStyleName(styleErreur);
|
|
|
145 |
}
|
|
|
146 |
|
|
|
147 |
@Override
|
|
|
148 |
public void remplirListeReferentiels(Map<String, String> listeReferentiels) {
|
|
|
149 |
for (Iterator<String> iterator = listeReferentiels.keySet().iterator(); iterator.hasNext();) {
|
|
|
150 |
String codeRef = iterator.next();
|
|
|
151 |
referentiel.addItem(listeReferentiels.get(codeRef), codeRef);
|
|
|
152 |
}
|
|
|
153 |
}
|
|
|
154 |
|
|
|
155 |
@Override
|
|
|
156 |
public void setReferentiel(String codeReferentiel) {
|
|
|
157 |
for(int i = 0; i < referentiel.getItemCount(); i++) {
|
|
|
158 |
if(referentiel.getValue(i).equals(codeReferentiel)) {
|
|
|
159 |
referentiel.setSelectedIndex(i);
|
|
|
160 |
}
|
|
|
161 |
}
|
|
|
162 |
}
|
|
|
163 |
|
|
|
164 |
@Override
|
|
|
165 |
public String getReferentiel() {
|
|
|
166 |
return referentiel.getValue(referentiel.getSelectedIndex());
|
|
|
167 |
}
|
|
|
168 |
}
|