Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 276 Rev 280
1
package org.tela_botanica.client.vues;
1
package org.tela_botanica.client.vues;
2
 
2
 
3
import java.util.HashMap;
3
import java.util.HashMap;
4
 
4
 
5
import org.tela_botanica.client.ComposantClass;
5
import org.tela_botanica.client.ComposantClass;
6
import org.tela_botanica.client.Mediateur;
6
import org.tela_botanica.client.Mediateur;
7
import org.tela_botanica.client.RegistreId;
7
import org.tela_botanica.client.RegistreId;
8
import org.tela_botanica.client.interfaces.Rafraichissable;
8
import org.tela_botanica.client.interfaces.Rafraichissable;
-
 
9
import org.tela_botanica.client.modeles.InterneValeur;
-
 
10
import org.tela_botanica.client.modeles.Personne;
-
 
11
import org.tela_botanica.client.modeles.Valeur;
9
 
12
 
10
 
13
 
11
import com.extjs.gxt.ui.client.Registry;
14
import com.extjs.gxt.ui.client.Registry;
12
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
15
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
13
import com.extjs.gxt.ui.client.event.ComponentEvent;
16
import com.extjs.gxt.ui.client.event.ComponentEvent;
14
import com.extjs.gxt.ui.client.event.KeyListener;
17
import com.extjs.gxt.ui.client.event.KeyListener;
-
 
18
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
-
 
19
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
15
import com.extjs.gxt.ui.client.event.SelectionListener;
20
import com.extjs.gxt.ui.client.event.SelectionListener;
-
 
21
import com.extjs.gxt.ui.client.store.ListStore;
-
 
22
import com.extjs.gxt.ui.client.store.Store;
16
import com.extjs.gxt.ui.client.widget.Container;
23
import com.extjs.gxt.ui.client.widget.Container;
17
import com.extjs.gxt.ui.client.widget.ContentPanel;
24
import com.extjs.gxt.ui.client.widget.ContentPanel;
-
 
25
import com.extjs.gxt.ui.client.widget.DatePicker;
18
import com.extjs.gxt.ui.client.widget.LayoutContainer;
26
import com.extjs.gxt.ui.client.widget.LayoutContainer;
19
import com.extjs.gxt.ui.client.widget.TabItem;
27
import com.extjs.gxt.ui.client.widget.TabItem;
20
import com.extjs.gxt.ui.client.widget.TabPanel;
28
import com.extjs.gxt.ui.client.widget.TabPanel;
-
 
29
import com.extjs.gxt.ui.client.widget.form.ComboBox;
-
 
30
import com.extjs.gxt.ui.client.widget.form.DateField;
21
import com.extjs.gxt.ui.client.widget.form.FieldSet;
31
import com.extjs.gxt.ui.client.widget.form.FieldSet;
22
import com.extjs.gxt.ui.client.widget.form.LabelField;
32
import com.extjs.gxt.ui.client.widget.form.LabelField;
23
import com.extjs.gxt.ui.client.widget.form.TextField;
33
import com.extjs.gxt.ui.client.widget.form.TextField;
-
 
34
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
24
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
35
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
25
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
36
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
26
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
37
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
27
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
38
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
28
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
39
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
29
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
40
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
30
import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem;
41
import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem;
31
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
42
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
32
 
43
 
33
import com.google.gwt.user.client.ui.Panel;
44
import com.google.gwt.user.client.ui.Panel;
34
import com.google.gwt.user.client.ui.Widget;
45
import com.google.gwt.user.client.ui.Widget;
35
 
46
 
36
 
47
 
37
 
48
 
38
public class FormPersonneVue extends ContentPanel implements Rafraichissable {
49
public class FormPersonneVue extends ContentPanel implements Rafraichissable {
39
	
50
	
40
	
51
	
41
	/*--------------------------------------------------------------------------------------
52
	/*--------------------------------------------------------------------------------------
42
	 * 		VARIABLES
53
	 * 		VARIABLES
43
	 * -------------------------------------------------------------------------------------
54
	 * -------------------------------------------------------------------------------------
44
	 */
55
	 */
45
	
56
	
46
	private TabItem tiIdentite, tiAdresses, tiInfosNat;
57
	private TabItem tiIdentite, tiAdresses, tiInfosNat;
47
	
58
	
48
	
59
	
49
	/*--------------------------------------------------------------------------------------
60
	/*--------------------------------------------------------------------------------------
50
	 * 		CONSTRUCTEUR 
61
	 * 		CONSTRUCTEUR 
51
	 * -------------------------------------------------------------------------------------
62
	 * -------------------------------------------------------------------------------------
52
	 */
63
	 */
53
	/**
64
	/**
54
	 * Constructeur du panneau
65
	 * Constructeur du panneau
55
	 * 
66
	 * 
56
	 * Initialise le panneau et ajoute une barre d'outils à deux boutons (réinitialiser le 
67
	 * Initialise le panneau et ajoute une barre d'outils à deux boutons (réinitialiser le 
57
	 * formulaire et annuler la saisie). 
68
	 * formulaire et annuler la saisie). 
58
	 * 
69
	 * 
59
	 * */
70
	 * */
60
	public FormPersonneVue() {
71
	public FormPersonneVue() {
61
		
72
		
62
		initialiserPanneau(this);
73
		initialiserPanneau(this);
63
		
74
		
64
		ToolBar barreOutils = new ToolBar();
75
		ToolBar barreOutils = new ToolBar();
65
		
76
		
66
		ajouterBoutonEnregistrer(barreOutils);
77
		ajouterBoutonEnregistrer(barreOutils);
67
		ajouterBoutonReinitialiser(barreOutils);
78
		ajouterBoutonReinitialiser(barreOutils);
68
		ajouterBoutonAnnuler(barreOutils);
79
		ajouterBoutonAnnuler(barreOutils);
69
		
80
		
70
		setTopComponent(barreOutils);
81
		setTopComponent(barreOutils);
71
		
82
		
72
		initialiserOnglets();	
83
		initialiserOnglets();	
73
		
84
		
74
		creerComposantsIdentite();
85
		creerComposantsIdentite();
-
 
86
		
75
	}
87
	}
76
	
88
	
77
	
89
	
78
	/*---------------------------------------------------------------------------------------
90
	/*---------------------------------------------------------------------------------------
79
	 * 		SOUS-METHODES
91
	 * 		SOUS-METHODES
80
	 * --------------------------------------------------------------------------------------
92
	 * --------------------------------------------------------------------------------------
81
	 */
93
	 */
82
	/**
94
	/**
83
	 * Inialise le panneau donné
95
	 * Inialise le panneau donné
84
	 * 
96
	 * 
85
	 * @param contentPanel le panneau à initialiser
97
	 * @param contentPanel le panneau à initialiser
86
	 * */
98
	 * */
87
	public void initialiserPanneau(ContentPanel contentPanel)	{
99
	public void initialiserPanneau(ContentPanel contentPanel)	{
88
		
100
		
89
		contentPanel.setLayout(new FitLayout());
101
		contentPanel.setLayout(new FitLayout());
90
		contentPanel.setIconStyle("icone-form-ajouter");  
102
		contentPanel.setIconStyle("icone-form-ajouter");  
91
		contentPanel.setCollapsible(false);  
103
		contentPanel.setCollapsible(false);  
92
		contentPanel.setHeading("Ajouter une personne");
104
		contentPanel.setHeading("Ajouter une personne");
93
		contentPanel.setButtonAlign(HorizontalAlignment.CENTER);  
105
		contentPanel.setButtonAlign(HorizontalAlignment.CENTER);  
94
		contentPanel.setLayout(new FormLayout());
106
		contentPanel.setLayout(new FormLayout());
95
	}
107
	}
96
	
108
	
97
	/**
109
	/**
98
	 * Crée les onglets identité, adresse et informations naturaliste
110
	 * Crée les onglets identité, adresse et informations naturaliste
99
	 * 
111
	 * 
100
	 * */
112
	 * */
101
	public void initialiserOnglets()	{
113
	public void initialiserOnglets()	{
102
		//TabPanel
114
		//TabPanel
103
		TabPanel formulaireOnglets = new TabPanel();
115
		TabPanel formulaireOnglets = new TabPanel();
104
		
116
		
105
		//Tab 1 : identite
117
		//Tab 1 : identite
106
		tiIdentite = new TabItem("Identité");
118
		tiIdentite = new TabItem("Identité");
107
		tiIdentite.setLayout(new FormLayout());
119
		tiIdentite.setLayout(new FormLayout());
108
		formulaireOnglets.add(tiIdentite);
120
		formulaireOnglets.add(tiIdentite);
109
		
121
		
110
		
122
		
111
		//Tab 2 : Adresse
123
		//Tab 2 : Adresse
112
		tiAdresses = new TabItem("Adresse");
124
		tiAdresses = new TabItem("Adresse");
113
		tiAdresses.setLayout(new FlowLayout());
125
		tiAdresses.setLayout(new FlowLayout());
114
		formulaireOnglets.add(tiAdresses);
126
		formulaireOnglets.add(tiAdresses);
115
		
127
		
116
		//Tab 3 : Infos Naturalistes
128
		//Tab 3 : Infos Naturalistes
117
		tiInfosNat = new TabItem("Informations Naturalistes");
129
		tiInfosNat = new TabItem("Informations Naturalistes");
118
		tiInfosNat.setLayout(new FormLayout());
130
		tiInfosNat.setLayout(new FormLayout());
119
		formulaireOnglets.add(tiInfosNat);
131
		formulaireOnglets.add(tiInfosNat);
120
		
132
		
121
		add(formulaireOnglets);
133
		add(formulaireOnglets);
122
	}
134
	}
123
	
135
	
124
	/**
136
	/**
125
	 * Crée les widgets pour l'onglet identité
137
	 * Crée les widgets pour l'onglet identité
126
	 * 
138
	 * 
127
	 * */
139
	 * */
128
	
140
	
129
	//hmIdentite référence par une chaine de caractère tous les composants de l'onglet Identite
141
	//hmIdentite référence par une chaine de caractère tous les composants de l'onglet Identite
130
	private HashMap<String, Widget>hmIdentite = new HashMap<String, Widget>();
142
	private HashMap<String, Widget>hmIdentite = new HashMap<String, Widget>();
131
	
143
	
132
	public void creerComposantsIdentite()	{
144
	public void creerComposantsIdentite()	{
133
		
145
		
134
			// Gestion de l'affichage en colonnes
146
			// Gestion de l'affichage en colonnes
135
			// On crée 3 Layout container : un principal, un pour la colonne de gauche, un pour la colonne de droite
147
			// On crée 3 Layout container : un principal, un pour la colonne de gauche, un pour la colonne de droite
136
		
148
		
137
			// Gauche
149
			// Gauche
138
			LayoutContainer left = new LayoutContainer();
150
			LayoutContainer left = new LayoutContainer();
139
			left.setLayout(new FormLayout());
151
			left.setLayout(new FormLayout());
140
			
152
			
141
			// Droite
153
			// Droite
142
			LayoutContainer right = new LayoutContainer();
154
			LayoutContainer right = new LayoutContainer();
143
			right.setLayout(new FormLayout());
155
			right.setLayout(new FormLayout());
144
			
156
			
145
			// Principal
157
			// Principal
146
			LayoutContainer main = new LayoutContainer();
158
			LayoutContainer main = new LayoutContainer();
147
			main.setLayout(new ColumnLayout());
159
			main.setLayout(new ColumnLayout());
148
			
160
			
149
			// Ajout au principal
161
			// Ajout au principal
150
			main.add(left, new ColumnData(.5));
162
			main.add(left, new ColumnData(.5));
151
			main.add(right, new ColumnData(.5));
163
			main.add(right, new ColumnData(.5));
152
			
164
			
153
			
165
			
154
			// Création des champs
166
			// Création des champs
155
			
167
			
156
			//FormLayout sera utilisé à plusieurs reprises
168
			//FormLayout sera utilisé à plusieurs reprises
157
			FormLayout formLayout = new FormLayout();
169
			FormLayout formLayout = new FormLayout();
158
			
170
			
159
			FieldSet fsNoms = new FieldSet();
171
			FieldSet fsNoms = new FieldSet();
160
			fsNoms.setHeading("Noms");
172
			fsNoms.setHeading("Noms");
161
			
173
			
162
			formLayout.setLabelAlign(LabelAlign.LEFT);
174
			formLayout.setLabelAlign(LabelAlign.LEFT);
163
			fsNoms.setLayout(formLayout); 
175
			fsNoms.setLayout(formLayout); 
164
			
176
			
165
			// Nom complet
177
			// Nom complet
166
			// Affiché que si valeurs saisies
178
			// Affiché que si valeurs saisies
167
			LabelField nomComplet = new LabelField();
179
			LabelField nomComplet = new LabelField();
168
			nomComplet.setFieldLabel("Nom complet:");
180
			nomComplet.setFieldLabel("Nom complet:");
169
			nomComplet.hide();
181
			nomComplet.hide();
170
			fsNoms.add(nomComplet);
182
			fsNoms.add(nomComplet);
171
			
183
			
172
			hmIdentite.put("nomComplet", nomComplet);
184
			hmIdentite.put("nomComplet", nomComplet);
173
			
185
			
174
			//Préfixe
186
			//Préfixe
-
 
187
			ComboBox<Valeur> cbPrefix = new ComboBox<Valeur>();
175
			TextField<String> tfPrefix = new TextField<String>();
188
			ListStore<Valeur> storePrefixe = new ListStore<Valeur>();
-
 
189
			cbPrefix.setStore(storePrefixe);
176
			tfPrefix.setFieldLabel("Préfixe");
190
			cbPrefix.setFieldLabel("Prefix");
177
			fsNoms.add(tfPrefix);
191
			fsNoms.add(cbPrefix);			
178
			
192
			
179
			hmIdentite.put("tfPrefix", tfPrefix);
193
			hmIdentite.put("cbPrefix", cbPrefix);
180
			
194
			
181
			//Prénom
195
			//Prénom
182
			TextField<String> tfPrenom = new TextField<String>();
196
			TextField<String> tfPrenom = new TextField<String>();
183
			tfPrenom.setFieldLabel("Prénom");
197
			tfPrenom.setFieldLabel("Prénom");
184
			fsNoms.add(tfPrenom);
198
			fsNoms.add(tfPrenom);
185
			
199
			
186
			hmIdentite.put("tfPrenom", tfPrenom);
200
			hmIdentite.put("tfPrenom", tfPrenom);
187
			
201
			
188
			//Nom
202
			//Nom
189
			TextField<String> tfNom = new TextField<String>();
203
			TextField<String> tfNom = new TextField<String>();
190
			tfNom.setFieldLabel("Nom");
204
			tfNom.setFieldLabel("Nom");
191
			fsNoms.add(tfNom);
205
			fsNoms.add(tfNom);
192
			
206
			
193
			hmIdentite.put("tfNom", tfNom);
207
			hmIdentite.put("tfNom", tfNom);
194
			
208
			
-
 
209
			//Préfixe
195
			//Suffixe
210
			ComboBox<Valeur> cbSuffixe = new ComboBox<Valeur>();
-
 
211
			ListStore<Valeur> storeSuffixe = new ListStore<Valeur>();
196
			TextField<String> tfSuffix = new TextField<String>();
212
			cbSuffixe.setStore(storeSuffixe);
197
			tfSuffix.setFieldLabel("Suffixe");
213
			cbSuffixe.setFieldLabel("Suffixe");
198
			fsNoms.add(tfSuffix);
214
			fsNoms.add(cbSuffixe);			
199
			
215
			
200
			hmIdentite.put("tfSuffix", tfSuffix);
216
			hmIdentite.put("cbSuffixe", cbSuffixe);
201
						
217
						
202
			// Nom : autre
218
			// Nom : autre
203
			TextField<String> tfNomAutre = new TextField();
219
			TextField<String> tfNomAutre = new TextField();
204
			tfNomAutre.setFieldLabel("Autres noms");
220
			tfNomAutre.setFieldLabel("Autres noms");
205
			fsNoms.add(tfNomAutre);
221
			fsNoms.add(tfNomAutre);
206
			
222
			
207
			hmIdentite.put("tfNomAutre", tfNomAutre);
223
			hmIdentite.put("tfNomAutre", tfNomAutre);
208
			
224
			
209
			//Abréviation
225
			//Abréviation
210
			TextField<String> tfAbreviation = new TextField<String>();
226
			TextField<String> tfAbreviation = new TextField<String>();
211
			tfAbreviation.setFieldLabel("Abréviation");
227
			tfAbreviation.setFieldLabel("Abréviation");
212
			fsNoms.add(tfAbreviation);
228
			fsNoms.add(tfAbreviation);
213
			
229
			
214
			hmIdentite.put("tfAbreviation", tfAbreviation);
230
			hmIdentite.put("tfAbreviation", tfAbreviation);
215
			
231
			
216
			//Abréviation autres
232
			//Abréviation autres
217
			TextField<String> tfAbreviationAutre = new TextField<String>();
233
			TextField<String> tfAbreviationAutre = new TextField<String>();
218
			tfAbreviationAutre.setFieldLabel("Autres Abrév.");
234
			tfAbreviationAutre.setFieldLabel("Autres Abrév.");
219
			fsNoms.add(tfAbreviationAutre);
235
			fsNoms.add(tfAbreviationAutre);
220
			
236
			
221
			hmIdentite.put("tfAbreviation", tfAbreviation);
237
			hmIdentite.put("tfAbreviation", tfAbreviation);
222
			
238
			
223
			
239
			
224
			left.add(fsNoms);
240
			left.add(fsNoms);
225
			
241
			
226
			// Naissance & décès
242
			// Naissance & décès
227
			FieldSet fsVie = new FieldSet();
243
			FieldSet fsVie = new FieldSet();
228
			fsVie.setHeading("Vie");
244
			fsVie.setHeading("Vie");
229
			
245
			
230
			formLayout = new FormLayout();
246
			formLayout = new FormLayout();
231
			formLayout.setLabelAlign(LabelAlign.LEFT);
247
			formLayout.setLabelAlign(LabelAlign.TOP);
232
			fsVie.setLayout(formLayout); 
248
			fsVie.setLayout(formLayout); 
233
			
249
			
234
			// Date naissance
250
			// Date naissance
-
 
251
			DateField dfDateNaissance = new DateField();
-
 
252
			
-
 
253
			dfDateNaissance.setFieldLabel("Date de naissance");
-
 
254
			fsVie.add(dfDateNaissance);
-
 
255
			
-
 
256
			hmIdentite.put("dfDateNaissance", dfDateNaissance);
-
 
257
			
-
 
258
			// Lieu naissance
235
			TextField<String> tfDateNaissance = new TextField();
259
			TextField<String> tfLieuNaissance = new TextField();
-
 
260
			tfLieuNaissance.setFieldLabel("Lieu de naissance");
-
 
261
			fsVie.add(tfLieuNaissance);
-
 
262
			
-
 
263
			hmIdentite.put("tfLieuNaissance", tfLieuNaissance);
-
 
264
			
-
 
265
			// Date décès
-
 
266
			DateField dfDateDeces = new DateField();
-
 
267
			dfDateDeces.setFieldLabel("Date de décès");
-
 
268
			fsVie.add(dfDateDeces);
-
 
269
			
-
 
270
			hmIdentite.put("dfDateDeces", dfDateDeces);
-
 
271
			
-
 
272
			// Lieu décès
-
 
273
			TextField<String> tfLieuDeces = new TextField();
-
 
274
			tfLieuDeces.setFieldLabel("Lieu de décès");
-
 
275
			fsVie.add(tfLieuDeces);
-
 
276
			
-
 
277
			hmIdentite.put("tfLieuDeces", tfLieuDeces);
-
 
278
			
-
 
279
			//Date picker
-
 
280
			DatePicker datePick = new DatePicker();
-
 
281
			
236
			
282
			
237
			
283
			left.add(fsVie);
238
			
284
			
239
			tiIdentite.add(main);
285
			tiIdentite.add(main);
240
			
286
			
241
			
287
			
242
			// Ajout des évènements saisi
288
			// Ajout des évènements saisi
243
			KeyListener klNoms = new KeyListener()	{
289
			KeyListener klNoms = new KeyListener()	{
244
				public void componentKeyUp(ComponentEvent ev)	{
290
				public void componentKeyUp(ComponentEvent ev)	{
245
						/*
291
						/*
246
						 * Met à jour le nom Complet du formulaire
292
						 * Met à jour le nom Complet du formulaire
247
						 * */
293
						 * */
248
						String valeurRetour = "";
294
						String valeurRetour = "";
249
						// Prefixe
295
						// Prefixe
250
						String prefixe = (String) ((TextField) hmIdentite.get("tfPrefix")).getValue();
296
						String prefixe = (String) ((ComboBox) hmIdentite.get("cbPrefix")).getSelectedText();
251
						
297
						
252
						// Prénom
298
						// Prénom
253
						String prenom = (String) ((TextField) hmIdentite.get("tfPrenom")).getValue();
299
						String prenom = (String) ((TextField) hmIdentite.get("tfPrenom")).getValue();
254
						
300
						
255
						// Nom
301
						// Nom
256
						String nom = (String) ((TextField) hmIdentite.get("tfNom")).getValue();
302
						String nom = (String) ((TextField) hmIdentite.get("tfNom")).getValue();
257
						
303
						
258
						// Suffixe
304
						// Suffixe
259
						String suffixe = (String) ((TextField) hmIdentite.get("tfSuffix")).getValue();
305
						String suffixe = (String) ((ComboBox) hmIdentite.get("cbSuffixe")).getSelectedText();
260
						
306
						
261
						// Mettre à jour la valeur
307
						// Mettre à jour la valeur
262
						valeurRetour = prefixe + " " + prenom + " " + nom + " " + suffixe;
308
						valeurRetour = prefixe + " " + prenom + " " + nom + " " + suffixe;
263
						valeurRetour = valeurRetour.replaceAll("null", "");
309
						valeurRetour = valeurRetour.replaceAll("null", "");
264
						
310
						
265
						((LabelField) hmIdentite.get("nomComplet")).setValue(valeurRetour);
311
						((LabelField) hmIdentite.get("nomComplet")).setValue(valeurRetour);
266
						
312
						
267
						if (!valeurRetour.trim().equals(""))	{
313
						if (!valeurRetour.trim().equals(""))	{
268
							((LabelField) hmIdentite.get("nomComplet")).show();
314
							((LabelField) hmIdentite.get("nomComplet")).show();
269
						} else {
315
						} else {
270
							((LabelField) hmIdentite.get("nomComplet")).hide();
316
							((LabelField) hmIdentite.get("nomComplet")).hide();
271
						}
317
						}
272
						
318
						
273
				}
319
				}				
274
			};
320
			};
275
			
321
			
276
			tfPrefix.addKeyListener(klNoms);
322
			cbPrefix.addKeyListener(klNoms);
277
			tfPrenom.addKeyListener(klNoms);
323
			tfPrenom.addKeyListener(klNoms);
278
			tfNom.addKeyListener(klNoms);
324
			tfNom.addKeyListener(klNoms);
279
			tfSuffix.addKeyListener(klNoms);
325
			cbSuffixe.addKeyListener(klNoms);
280
			
326
			
281
			
327
			
282
			//Prénom
328
			//Prénom
-
 
329
		
-
 
330
			
-
 
331
			this.recalculate();
-
 
332
			fsNoms.recalculate();
-
 
333
			fsNoms.layout();
-
 
334
			this.layout();
-
 
335
			this.hide();
-
 
336
			
-
 
337
			rafraichir(null);
-
 
338
			
283
		
339
			
284
	}
-
 
285
	
-
 
286
	public void ajouterTextField(String id, String strLabel, Panel panel)	{
-
 
287
		
-
 
288
		TextField tf = new TextField();
-
 
289
		tf.setFieldLabel(strLabel);
-
 
290
		panel.add(tf);
-
 
291
		
-
 
292
		hmIdentite.put(id, tf);
-
 
293
	}
-
 
294
	
-
 
295
	public void ajouterLabelField(String id, String strLabel, Panel panel)	{
-
 
296
		
-
 
297
		LabelField tf = new LabelField();
-
 
298
		tf.setFieldLabel(strLabel);
-
 
299
		panel.add(tf);
-
 
300
		
-
 
301
		hmIdentite.put(id, tf);
-
 
302
	}
-
 
303
	
340
	}
304
	
341
	
305
	/**
342
	/**
306
	 * Ajouter le bouton réinitialiser à la barre d'outils donnée
343
	 * Ajouter le bouton réinitialiser à la barre d'outils donnée
307
	 * 
344
	 * 
308
	 * @param barreOutils la barre d'outils à modifier
345
	 * @param barreOutils la barre d'outils à modifier
309
	 * */
346
	 * */
310
	public static void ajouterBoutonReinitialiser(ToolBar barreOutils)	{
347
	public static void ajouterBoutonReinitialiser(ToolBar barreOutils)	{
311
		
348
		
312
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
349
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
313
		TextToolItem reinitialiser = new TextToolItem("Réinitialiser");
350
		TextToolItem reinitialiser = new TextToolItem("Réinitialiser");
314
		reinitialiser.setIconStyle(ComposantClass.ICONE_RAFRAICHIR);
351
		reinitialiser.setIconStyle(ComposantClass.ICONE_RAFRAICHIR);
315
		reinitialiser.addSelectionListener(new SelectionListener<ComponentEvent>() {  
352
		reinitialiser.addSelectionListener(new SelectionListener<ComponentEvent>() {  
316
			public void componentSelected(ComponentEvent ce) {  
353
			public void componentSelected(ComponentEvent ce) {  
317
				((Mediateur) Registry.get(RegistreId.MEDIATEUR)).clicAjouterPersonne();
354
				((Mediateur) Registry.get(RegistreId.MEDIATEUR)).clicAjouterPersonne();
318
			}  
355
			}  
319
		});
356
		});
320
		barreOutils.add(reinitialiser);
357
		barreOutils.add(reinitialiser);
321
	}
358
	}
322
	
359
	
323
	/**
360
	/**
324
	 * Ajouter le bouton Sauvegarder à la barre d'outils donnée
361
	 * Ajouter le bouton Sauvegarder à la barre d'outils donnée
325
	 * 
362
	 * 
326
	 * @param barreOutils la barre d'outils à modifier
363
	 * @param barreOutils la barre d'outils à modifier
327
	 * */
364
	 * */
328
	public static void ajouterBoutonEnregistrer(ToolBar barreOutils)	{
365
	public static void ajouterBoutonEnregistrer(ToolBar barreOutils)	{
329
		
366
		
330
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
367
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
331
		TextToolItem reinitialiser = new TextToolItem("Enregistrer");
368
		TextToolItem reinitialiser = new TextToolItem("Enregistrer");
332
		reinitialiser.setIconStyle(ComposantClass.ICONE_PREFERENCE);
369
		reinitialiser.setIconStyle(ComposantClass.ICONE_PREFERENCE);
333
		reinitialiser.addSelectionListener(new SelectionListener<ComponentEvent>() {  
370
		reinitialiser.addSelectionListener(new SelectionListener<ComponentEvent>() {  
334
			public void componentSelected(ComponentEvent ce) {  
371
			public void componentSelected(ComponentEvent ce) {  
335
				// TODO : Enregistrer le formulaire
372
				// TODO : Enregistrer le formulaire
336
			}  
373
			}  
337
		});
374
		});
338
		barreOutils.add(reinitialiser);
375
		barreOutils.add(reinitialiser);
339
	}
376
	}
340
	
377
	
341
	/**
378
	/**
342
	 * Ajouter le bouton annuler à la barre d'outils donnée
379
	 * Ajouter le bouton annuler à la barre d'outils donnée
343
	 * 
380
	 * 
344
	 * @param barreOutils la barre d'outils à modifier
381
	 * @param barreOutils la barre d'outils à modifier
345
	 * */
382
	 * */
346
	public static void ajouterBoutonAnnuler(ToolBar barreOutils)	{
383
	public static void ajouterBoutonAnnuler(ToolBar barreOutils)	{
347
		
384
		
348
		// Le bouton annuler ne sauvegarde pas les informations et renvoie vers la page précédente
385
		// Le bouton annuler ne sauvegarde pas les informations et renvoie vers la page précédente
349
		TextToolItem annuler = new TextToolItem("Annuler");
386
		TextToolItem annuler = new TextToolItem("Annuler");
350
		annuler.addSelectionListener(new SelectionListener<ComponentEvent>() {  
387
		annuler.addSelectionListener(new SelectionListener<ComponentEvent>() {  
351
			public void componentSelected(ComponentEvent ce) {  
388
			public void componentSelected(ComponentEvent ce) {  
352
				((Mediateur) Registry.get(RegistreId.MEDIATEUR)).clicMenu("Personnes");
389
				((Mediateur) Registry.get(RegistreId.MEDIATEUR)).clicMenu("Personnes");
353
			}  
390
			}  
354
		});
391
		});
355
		annuler.setIconStyle(ComposantClass.ICONE_SUPPRIMER);
392
		annuler.setIconStyle(ComposantClass.ICONE_SUPPRIMER);
356
		barreOutils.add(annuler);
393
		barreOutils.add(annuler);
357
	}
394
	}
358
	
395
	
359
	
396
	
360
	
397
	
361
	/*---------------------------------------------------------------------------------------
398
	/*---------------------------------------------------------------------------------------
362
	 * 		RAFRAICHISSEMENT DU PANNEAU
399
	 * 		RAFRAICHISSEMENT DU PANNEAU
363
	 * --------------------------------------------------------------------------------------
400
	 * --------------------------------------------------------------------------------------
364
	 */	
401
	 */	
365
	public void rafraichir(Object nouvelleDonnees) {
402
	public void rafraichir(Object nouvelleDonnees) {
366
		// TODO Auto-generated method stub
403
		// TODO Auto-generated method stub
367
		
404
		this.show();
-
 
405
		this.layout();
-
 
406
		this.recalculate();		
368
	}
407
	}
369
 
408
 
370
	
409
	
371
 
410
 
372
 
411
 
373
}
412
}