Subversion Repositories eFlore/Applications.coel

Rev

Rev 247 | Rev 259 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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