| 150 |
gduche |
1 |
package org.tela_botanica.client.vues;
|
|
|
2 |
|
| 189 |
gduche |
3 |
|
|
|
4 |
|
| 253 |
gduche |
5 |
|
|
|
6 |
|
|
|
7 |
import java.util.Collection;
|
| 197 |
gduche |
8 |
import java.util.HashMap;
|
|
|
9 |
import java.util.Iterator;
|
| 253 |
gduche |
10 |
import java.util.LinkedList;
|
|
|
11 |
import java.util.MissingResourceException;
|
| 189 |
gduche |
12 |
|
| 197 |
gduche |
13 |
|
| 150 |
gduche |
14 |
import org.tela_botanica.client.RegistreId;
|
| 253 |
gduche |
15 |
import org.tela_botanica.client.i18n.Constantes;
|
| 150 |
gduche |
16 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
|
|
17 |
import org.tela_botanica.client.modeles.Personne;
|
| 259 |
gduche |
18 |
import org.tela_botanica.client.util.UtilTruk;
|
| 150 |
gduche |
19 |
|
|
|
20 |
import com.extjs.gxt.ui.client.Registry;
|
| 259 |
gduche |
21 |
|
|
|
22 |
|
| 150 |
gduche |
23 |
import com.extjs.gxt.ui.client.Style.Scroll;
|
| 253 |
gduche |
24 |
import com.extjs.gxt.ui.client.Style.VerticalAlignment;
|
| 259 |
gduche |
25 |
|
| 215 |
aurelien |
26 |
import com.extjs.gxt.ui.client.widget.ContentPanel;
|
| 189 |
gduche |
27 |
import com.extjs.gxt.ui.client.widget.TabItem;
|
|
|
28 |
import com.extjs.gxt.ui.client.widget.TabPanel;
|
| 197 |
gduche |
29 |
import com.extjs.gxt.ui.client.widget.form.FieldSet;
|
| 246 |
gduche |
30 |
import com.extjs.gxt.ui.client.widget.form.LabelField;
|
| 150 |
gduche |
31 |
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
| 197 |
gduche |
32 |
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
|
|
|
33 |
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
|
| 253 |
gduche |
34 |
import com.extjs.gxt.ui.client.widget.layout.TableData;
|
| 197 |
gduche |
35 |
import com.extjs.gxt.ui.client.widget.layout.TableLayout;
|
| 253 |
gduche |
36 |
import com.google.gwt.core.client.GWT;
|
| 260 |
gduche |
37 |
import com.google.gwt.user.client.Window;
|
| 197 |
gduche |
38 |
import com.google.gwt.user.client.ui.Image;
|
| 150 |
gduche |
39 |
|
| 189 |
gduche |
40 |
public class PersonneDetailPanneauVue extends TabPanel implements Rafraichissable {
|
| 150 |
gduche |
41 |
|
| 197 |
gduche |
42 |
// Le panneau détail se compose de formulaires tabulés
|
| 189 |
gduche |
43 |
|
| 197 |
gduche |
44 |
// Onglet 1 : identite & contact
|
| 215 |
aurelien |
45 |
private TabItem tabIdentite;
|
|
|
46 |
|
|
|
47 |
private ContentPanel panneauIdentite;
|
|
|
48 |
private ContentPanel panneauImage;
|
|
|
49 |
|
| 197 |
gduche |
50 |
private FieldSet fsIdentite;
|
|
|
51 |
private FieldSet fsContact;
|
| 189 |
gduche |
52 |
|
| 200 |
gduche |
53 |
// Onglet 2 : Adresses
|
|
|
54 |
private TabItem tabAdresse;
|
|
|
55 |
private FieldSet fsAdressePerso;
|
| 198 |
gduche |
56 |
// contient : adresse perso / adresse pro
|
|
|
57 |
|
| 215 |
aurelien |
58 |
// Onglet 3 : Informations naturalistes
|
|
|
59 |
private TabItem tabInfosNat;
|
| 198 |
gduche |
60 |
|
| 150 |
gduche |
61 |
public PersonneDetailPanneauVue() {
|
| 189 |
gduche |
62 |
|
| 198 |
gduche |
63 |
//Constructeur de la classe
|
| 150 |
gduche |
64 |
Registry.register(RegistreId.PANNEAU_PERSONNE_DETAIL, this);
|
| 189 |
gduche |
65 |
setLayout(new FitLayout());
|
| 150 |
gduche |
66 |
|
| 215 |
aurelien |
67 |
tabIdentite = new TabItem("Identité");
|
|
|
68 |
TableLayout tLayout = new TableLayout(2);
|
|
|
69 |
tabIdentite.setLayout(tLayout);
|
|
|
70 |
tabIdentite.setScrollMode(Scroll.AUTO);
|
| 189 |
gduche |
71 |
|
| 215 |
aurelien |
72 |
panneauIdentite = new ContentPanel();
|
|
|
73 |
panneauIdentite.setWidth("400px");
|
|
|
74 |
panneauIdentite.setHeaderVisible(false);
|
|
|
75 |
panneauIdentite.setBorders(false);
|
|
|
76 |
panneauIdentite.setBodyBorder(false);
|
|
|
77 |
panneauImage = new ContentPanel();
|
| 253 |
gduche |
78 |
panneauImage.setLayout(new FlowLayout());
|
| 215 |
aurelien |
79 |
panneauImage.setBorders(false);
|
| 253 |
gduche |
80 |
panneauImage.setWidth(350);
|
| 215 |
aurelien |
81 |
panneauImage.setBodyBorder(false);
|
|
|
82 |
panneauImage.setHeaderVisible(false);
|
| 200 |
gduche |
83 |
|
| 259 |
gduche |
84 |
//Gérer l'alignement vertical en haut
|
| 253 |
gduche |
85 |
TableData td = new TableData();
|
| 259 |
gduche |
86 |
td.setVerticalAlign(VerticalAlignment.TOP);
|
|
|
87 |
|
|
|
88 |
tabIdentite.add(panneauIdentite, td);
|
| 253 |
gduche |
89 |
tabIdentite.add(panneauImage, td);
|
| 259 |
gduche |
90 |
|
| 253 |
gduche |
91 |
|
| 197 |
gduche |
92 |
fsIdentite = new FieldSet();
|
|
|
93 |
fsIdentite.setLayout(new FormLayout());
|
|
|
94 |
|
|
|
95 |
|
|
|
96 |
fsContact = new FieldSet();
|
|
|
97 |
fsContact.setLayout(new FormLayout());
|
|
|
98 |
|
| 215 |
aurelien |
99 |
this.add(tabIdentite);
|
| 197 |
gduche |
100 |
|
| 200 |
gduche |
101 |
//Onglet Adresse:
|
| 259 |
gduche |
102 |
tabAdresse = new TabItem("Adresses");
|
| 200 |
gduche |
103 |
fsAdressePerso = new FieldSet();
|
|
|
104 |
fsAdressePerso.setLayout(new FormLayout());
|
|
|
105 |
|
| 215 |
aurelien |
106 |
this.add(tabAdresse);
|
| 200 |
gduche |
107 |
|
| 215 |
aurelien |
108 |
//Onglet info naturalistes
|
|
|
109 |
tabInfosNat = new TabItem("Informations naturalistes");
|
| 200 |
gduche |
110 |
|
| 215 |
aurelien |
111 |
this.add(tabInfosNat);
|
| 198 |
gduche |
112 |
|
| 150 |
gduche |
113 |
}
|
|
|
114 |
|
|
|
115 |
public void afficherDetailPersonne(Personne personne) {
|
|
|
116 |
if (personne != null) {
|
| 198 |
gduche |
117 |
|
|
|
118 |
|
|
|
119 |
//MAJ Identité : Configurer les fieldSet
|
| 215 |
aurelien |
120 |
panneauIdentite.removeAll();
|
|
|
121 |
panneauImage.removeAll();
|
| 150 |
gduche |
122 |
|
| 197 |
gduche |
123 |
fsIdentite.setHeading("Identité");
|
| 259 |
gduche |
124 |
//fsIdentite.setWidth("350px");
|
| 183 |
gduche |
125 |
|
| 197 |
gduche |
126 |
fsContact.setHeading("Contact");
|
| 259 |
gduche |
127 |
//fsContact.setWidth("350px");
|
| 183 |
gduche |
128 |
|
| 215 |
aurelien |
129 |
panneauIdentite.add(fsIdentite);
|
|
|
130 |
|
| 259 |
gduche |
131 |
|
| 253 |
gduche |
132 |
//La personne peut avoir un ou plusieurs logo
|
|
|
133 |
panneauImage.setHeight("100%");
|
| 259 |
gduche |
134 |
panneauImage.setPosition(0, 6);
|
|
|
135 |
panneauImage.setBorders(false);
|
| 198 |
gduche |
136 |
|
| 253 |
gduche |
137 |
LinkedList<String> listeLogos = (LinkedList<String>) personne.getChaineDenormaliseAsMapOrList("truk_logo");
|
|
|
138 |
if ((listeLogos != null)&&(listeLogos.size() > 0)) {
|
| 259 |
gduche |
139 |
panneauImage.setBorders(true);
|
| 253 |
gduche |
140 |
for (int i = 0; i < listeLogos.size(); i++) {
|
|
|
141 |
String logoUrl = listeLogos.get(i);
|
|
|
142 |
if ((logoUrl!=null)&&(!logoUrl.trim().equals(""))) {
|
|
|
143 |
//Si c'est le cas, on l'affiche sur la même ligne que fsIdentité
|
|
|
144 |
Image img = new Image();
|
|
|
145 |
img.setUrl(logoUrl);
|
|
|
146 |
|
|
|
147 |
panneauImage.add(img);
|
|
|
148 |
if (panneauImage.getWidth() < (img.getWidth() + 15)) {
|
|
|
149 |
panneauImage.setWidth(img.getWidth() + 15);
|
|
|
150 |
}
|
|
|
151 |
|
|
|
152 |
}
|
|
|
153 |
}
|
| 246 |
gduche |
154 |
|
| 189 |
gduche |
155 |
}
|
| 150 |
gduche |
156 |
|
| 215 |
aurelien |
157 |
panneauIdentite.add(fsContact);
|
| 183 |
gduche |
158 |
|
| 197 |
gduche |
159 |
fsIdentite.removeAll();
|
|
|
160 |
fsContact.removeAll();
|
| 215 |
aurelien |
161 |
fsAdressePerso.removeAll();
|
| 197 |
gduche |
162 |
//Ajout des champs Identité
|
|
|
163 |
|
|
|
164 |
|
|
|
165 |
|
|
|
166 |
// TODO: projet
|
|
|
167 |
|
|
|
168 |
// nom complet
|
|
|
169 |
Object nomComplet = personne.obtenirValeurChamp("fmt_nom_complet");
|
| 253 |
gduche |
170 |
ajouterTextFieldNonEditable(fsIdentite,"Nom Complet", nomComplet);
|
| 197 |
gduche |
171 |
|
| 259 |
gduche |
172 |
// Nom autre : champ truk; non-typé
|
|
|
173 |
LinkedList<String> nomsAutre = (LinkedList<String>) personne.getChaineDenormaliseAsMapOrList("truk_nom_autre");
|
|
|
174 |
if ((nomsAutre != null)&&(nomsAutre.size() > 0)) {
|
|
|
175 |
|
|
|
176 |
LabelField noms = new LabelField();
|
|
|
177 |
noms.setFieldLabel("Autres noms:");
|
|
|
178 |
String listeNoms = UtilTruk.traiterTrukListe(nomsAutre, ", ");
|
|
|
179 |
noms.setValue(listeNoms);
|
|
|
180 |
fsIdentite.add(noms);
|
|
|
181 |
}
|
| 197 |
gduche |
182 |
|
|
|
183 |
// abreviation
|
|
|
184 |
Object abreviation = personne.obtenirValeurChamp("abreviation");
|
|
|
185 |
ajouterTextFieldNonEditable(fsIdentite, "Abreviation", abreviation);
|
|
|
186 |
|
| 259 |
gduche |
187 |
// Abréviations, autre : non-typé
|
|
|
188 |
LinkedList<String> abrevAutres = (LinkedList<String>) personne.getChaineDenormaliseAsMapOrList("truk_abreviation_autre");
|
|
|
189 |
if ((abrevAutres != null)&&(abrevAutres.size() > 0)) {
|
|
|
190 |
|
|
|
191 |
LabelField abreviations = new LabelField();
|
|
|
192 |
abreviations.setFieldLabel("Autres abreviations:");
|
|
|
193 |
String listeAbrev = UtilTruk.traiterTrukListe(abrevAutres, ", ");
|
|
|
194 |
abreviations.setValue(listeAbrev);
|
|
|
195 |
fsIdentite.add(abreviations);
|
|
|
196 |
}
|
|
|
197 |
fsIdentite.addText("<hr>");
|
| 197 |
gduche |
198 |
|
| 259 |
gduche |
199 |
// date naissance
|
|
|
200 |
// TODO : Mettre la date en format FR 10/12/09
|
|
|
201 |
Object dateNaissance = personne.obtenirValeurChamp("naissance_date");
|
|
|
202 |
ajouterTextFieldNonEditable(fsIdentite, "Né le", dateNaissance);
|
|
|
203 |
|
| 197 |
gduche |
204 |
// lieu naissance
|
| 259 |
gduche |
205 |
Object lieuNaissance = personne.obtenirValeurChamp("naissance_lieu");
|
|
|
206 |
ajouterTextFieldNonEditable(fsIdentite, "A", lieuNaissance);
|
| 197 |
gduche |
207 |
|
|
|
208 |
// date deces
|
| 259 |
gduche |
209 |
Object dateDeces = personne.obtenirValeurChamp("deces_date");
|
|
|
210 |
ajouterTextFieldNonEditable(fsIdentite, "Date décès", dateDeces);
|
| 197 |
gduche |
211 |
|
|
|
212 |
// lieu deces
|
| 259 |
gduche |
213 |
Object lieuDeces = personne.obtenirValeurChamp("deces_lieu");
|
| 197 |
gduche |
214 |
ajouterTextFieldNonEditable(fsIdentite, "Lieu de décès", lieuDeces);
|
|
|
215 |
|
| 259 |
gduche |
216 |
fsIdentite.addText("<hr>");
|
|
|
217 |
|
| 200 |
gduche |
218 |
//Description
|
|
|
219 |
String description = (String) personne.obtenirValeurChamp("description");
|
|
|
220 |
if ((description!=null)&&(!description.trim().equals(""))) {
|
| 253 |
gduche |
221 |
LabelField txtDescription = new LabelField();
|
|
|
222 |
txtDescription.setFieldLabel("Description:");
|
| 200 |
gduche |
223 |
txtDescription.setValue(description);
|
|
|
224 |
|
| 253 |
gduche |
225 |
//rendreNonEditable(txtDescription);
|
| 200 |
gduche |
226 |
|
|
|
227 |
fsIdentite.add(txtDescription);
|
|
|
228 |
}
|
| 197 |
gduche |
229 |
|
|
|
230 |
|
| 253 |
gduche |
231 |
// CONTACT
|
|
|
232 |
// Téléphones
|
|
|
233 |
// > Plusieurs téléphones possible, typés
|
|
|
234 |
Constantes constantesI18n = (Constantes) GWT.create(Constantes.class);
|
| 197 |
gduche |
235 |
|
| 253 |
gduche |
236 |
HashMap<String, String> mapTelephones = (HashMap<String, String>) personne.getChaineDenormaliseAsMapOrList("truk_telephone");
|
|
|
237 |
if ((mapTelephones != null)&&(mapTelephones.size() > 0)) {
|
|
|
238 |
|
|
|
239 |
Collection<String> telephoneKeys = mapTelephones.keySet();
|
|
|
240 |
Iterator<String> itTelephones = telephoneKeys.iterator();
|
|
|
241 |
|
|
|
242 |
while (itTelephones.hasNext()) {
|
|
|
243 |
String key = itTelephones.next();
|
|
|
244 |
LabelField telephoneLabel = new LabelField();
|
|
|
245 |
String label = "";
|
|
|
246 |
try {
|
|
|
247 |
label = constantesI18n.getString(key);
|
|
|
248 |
}
|
|
|
249 |
catch (MissingResourceException e) {
|
|
|
250 |
label = key;
|
|
|
251 |
}
|
|
|
252 |
|
|
|
253 |
telephoneLabel.setFieldLabel( label + ":");
|
|
|
254 |
|
|
|
255 |
telephoneLabel.setValue(mapTelephones.get(key));
|
|
|
256 |
|
|
|
257 |
fsContact.add(telephoneLabel);
|
|
|
258 |
}
|
| 215 |
aurelien |
259 |
}
|
| 197 |
gduche |
260 |
|
| 253 |
gduche |
261 |
// Fax
|
|
|
262 |
// > Plusieurs fax possible, typés
|
|
|
263 |
|
|
|
264 |
HashMap<String, String> mapFax = (HashMap<String, String>) personne.getChaineDenormaliseAsMapOrList("truk_fax");
|
|
|
265 |
if ((mapFax != null)&&(mapFax.size() > 0)) {
|
|
|
266 |
|
|
|
267 |
Collection<String> faxKeys = mapFax.keySet();
|
|
|
268 |
Iterator<String> itFax = faxKeys.iterator();
|
|
|
269 |
|
|
|
270 |
while (itFax.hasNext()) {
|
|
|
271 |
String key = itFax.next();
|
|
|
272 |
LabelField faxLabel = new LabelField();
|
|
|
273 |
String label = "";
|
|
|
274 |
try {
|
|
|
275 |
label = constantesI18n.getString(key);
|
|
|
276 |
}
|
|
|
277 |
catch (MissingResourceException e) {
|
|
|
278 |
label = key;
|
|
|
279 |
}
|
|
|
280 |
|
|
|
281 |
faxLabel.setFieldLabel( label + ":");
|
|
|
282 |
|
|
|
283 |
faxLabel.setValue(mapTelephones.get(key));
|
|
|
284 |
|
|
|
285 |
fsContact.add(faxLabel);
|
|
|
286 |
}
|
|
|
287 |
}
|
|
|
288 |
|
|
|
289 |
// Courriel
|
|
|
290 |
// Courriel est un champ truk de la forme "Adresse@adr.com;; adr2@adr.fr ..."
|
|
|
291 |
|
|
|
292 |
LinkedList<String> listeCourriel = (LinkedList<String>) personne.getChaineDenormaliseAsMapOrList("truk_courriel");
|
|
|
293 |
if ((listeCourriel!=null)&&(listeCourriel.size() > 0)) {
|
|
|
294 |
String strLabelCourriel = "Courriel";
|
|
|
295 |
if (listeCourriel.size() > 1) {
|
|
|
296 |
strLabelCourriel += "s";
|
|
|
297 |
}
|
|
|
298 |
|
|
|
299 |
LabelField labelCourriel = new LabelField();
|
|
|
300 |
labelCourriel.setFieldLabel(strLabelCourriel);
|
|
|
301 |
|
|
|
302 |
String valeurCourriel = "";
|
|
|
303 |
Iterator<String> itCourriel = listeCourriel.iterator();
|
|
|
304 |
while (itCourriel.hasNext()) {
|
|
|
305 |
String valeurCourante = itCourriel.next();
|
|
|
306 |
valeurCourriel += "<a href=\"mailto:" + valeurCourante + "\">" + valeurCourante + "</a><br />";
|
|
|
307 |
|
|
|
308 |
}
|
|
|
309 |
|
|
|
310 |
labelCourriel.setValue(valeurCourriel);
|
|
|
311 |
fsContact.add(labelCourriel);
|
|
|
312 |
}
|
|
|
313 |
|
|
|
314 |
|
| 260 |
gduche |
315 |
// Url Site Webs
|
|
|
316 |
LinkedList listeUrl = (LinkedList) personne.getChaineDenormaliseAsMapOrList("truk_url");
|
|
|
317 |
if (listeUrl!=null && listeUrl.size() > 0) {
|
|
|
318 |
String strUrl = "";
|
|
|
319 |
Iterator<String> urlIt = listeUrl.iterator();
|
|
|
320 |
while (urlIt.hasNext()) {
|
|
|
321 |
String urlCourante = urlIt.next();
|
|
|
322 |
strUrl += "<a href=\""+urlCourante+"\">" + urlCourante + "</a> <br/>";
|
|
|
323 |
|
|
|
324 |
|
|
|
325 |
}
|
|
|
326 |
|
|
|
327 |
LabelField urlLabelField = new LabelField();
|
|
|
328 |
urlLabelField.setFieldLabel("Url:");
|
|
|
329 |
urlLabelField.setValue(strUrl);
|
|
|
330 |
fsContact.add(urlLabelField);
|
|
|
331 |
}
|
|
|
332 |
|
|
|
333 |
|
| 215 |
aurelien |
334 |
panneauIdentite.add(fsContact);
|
| 197 |
gduche |
335 |
|
| 198 |
gduche |
336 |
|
| 215 |
aurelien |
337 |
fsAdressePerso.setHeading("Adresse personnelle");
|
|
|
338 |
|
| 198 |
gduche |
339 |
/*
|
|
|
340 |
* Adresses :
|
| 215 |
aurelien |
341 |
* */
|
| 197 |
gduche |
342 |
String adresse01 = (String) personne.obtenirValeurChamp("adresse_01");
|
| 215 |
aurelien |
343 |
ajouterTextFieldNonEditable(fsAdressePerso, "Adresse", adresse01);
|
| 197 |
gduche |
344 |
|
|
|
345 |
|
|
|
346 |
String adresse02 = (String) personne.obtenirValeurChamp("adresse_02");
|
| 215 |
aurelien |
347 |
ajouterTextFieldNonEditable(fsAdressePerso, "", adresse02);
|
| 197 |
gduche |
348 |
|
|
|
349 |
String boitePostale = (String) personne.obtenirValeurChamp("bp");
|
| 215 |
aurelien |
350 |
ajouterTextFieldNonEditable(fsAdressePerso, "Boite Postale", boitePostale);
|
| 197 |
gduche |
351 |
|
|
|
352 |
String codePostal = (String) personne.obtenirValeurChamp("code_postal");
|
| 215 |
aurelien |
353 |
ajouterTextFieldNonEditable(fsAdressePerso, "Code postal", codePostal);
|
| 197 |
gduche |
354 |
|
|
|
355 |
String ville = (String) personne.obtenirValeurChamp("ville");
|
| 215 |
aurelien |
356 |
ajouterTextFieldNonEditable(fsAdressePerso, "Ville", ville);
|
| 197 |
gduche |
357 |
|
|
|
358 |
String region = (String) personne.obtenirValeurChamp("region");
|
| 215 |
aurelien |
359 |
ajouterTextFieldNonEditable(fsAdressePerso, "Région", region);
|
| 197 |
gduche |
360 |
|
|
|
361 |
String pays = (String) personne.obtenirValeurChamp("pays");
|
| 215 |
aurelien |
362 |
ajouterTextFieldNonEditable(fsAdressePerso, "Pays", pays);
|
| 197 |
gduche |
363 |
|
| 215 |
aurelien |
364 |
fsAdressePerso.addText("<br >");
|
|
|
365 |
fsAdressePerso.setWidth("350px");
|
| 197 |
gduche |
366 |
|
| 215 |
aurelien |
367 |
tabAdresse.add(fsAdressePerso);
|
|
|
368 |
tabAdresse.setScrollMode(Scroll.AUTO);
|
| 246 |
gduche |
369 |
|
| 215 |
aurelien |
370 |
|
| 260 |
gduche |
371 |
/*
|
|
|
372 |
* Infos naturalistes
|
|
|
373 |
* */
|
|
|
374 |
|
|
|
375 |
// Biographie
|
|
|
376 |
// tabInfosNat
|
| 150 |
gduche |
377 |
layout();
|
| 197 |
gduche |
378 |
}
|
|
|
379 |
}
|
|
|
380 |
|
| 200 |
gduche |
381 |
private void ajouterTextFieldNonEditable(FieldSet fs, String tfLabel, Object tfValue) {
|
| 197 |
gduche |
382 |
|
|
|
383 |
if ((tfValue!=null)&&(!tfValue.toString().trim().equals(""))) {
|
| 189 |
gduche |
384 |
|
| 246 |
gduche |
385 |
|
|
|
386 |
LabelField tf = new LabelField();
|
| 197 |
gduche |
387 |
|
| 246 |
gduche |
388 |
tf.setFieldLabel(tfLabel + ":");
|
| 197 |
gduche |
389 |
if ((tfLabel==null)||("".equals(tfLabel))) {
|
|
|
390 |
tf.setHideLabel(true);
|
|
|
391 |
tf.setStyleAttribute("margin", "0 0 0 105px");
|
|
|
392 |
}
|
|
|
393 |
tf.setValue(tfValue);
|
|
|
394 |
|
|
|
395 |
// Non éditable : on empêche l'évènement par défaut
|
| 247 |
gduche |
396 |
// > MAJ 27/07 : inutile avec LabelField
|
|
|
397 |
//rendreNonEditable(tf);
|
| 246 |
gduche |
398 |
|
| 200 |
gduche |
399 |
//Ajout au fieldSet
|
|
|
400 |
fs.add(tf);
|
|
|
401 |
}
|
|
|
402 |
}
|
|
|
403 |
|
| 253 |
gduche |
404 |
/*
|
|
|
405 |
* private void rendreNonEditable(Field field) {
|
| 197 |
gduche |
406 |
|
| 200 |
gduche |
407 |
field.addKeyListener(new KeyListener() {
|
| 197 |
gduche |
408 |
public void componentKeyPress(ComponentEvent ev) {
|
|
|
409 |
ev.stopEvent();
|
|
|
410 |
}
|
|
|
411 |
});
|
| 200 |
gduche |
412 |
}
|
| 253 |
gduche |
413 |
*/
|
| 197 |
gduche |
414 |
|
|
|
415 |
|
| 183 |
gduche |
416 |
public void rafraichir(Object nouvelleDonnees) {
|
| 227 |
aurelien |
417 |
|
|
|
418 |
// Si on a reçu une personne on en affiche les détails
|
| 183 |
gduche |
419 |
if (nouvelleDonnees instanceof Personne) {
|
|
|
420 |
afficherDetailPersonne((Personne) nouvelleDonnees);
|
| 227 |
aurelien |
421 |
}
|
| 150 |
gduche |
422 |
}
|
|
|
423 |
|
| 197 |
gduche |
424 |
}
|