Subversion Repositories eFlore/Applications.cel

Rev

Rev 97 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
12 david 1
package org.tela_botanica.client.vues;
2
 
3
 
4
 
13 david 5
import java.util.Iterator;
6
 
7
import org.tela_botanica.client.interfaces.Rafraichissable;
8
import org.tela_botanica.client.modeles.ListeReferentielCommune;
20 david 9
import org.tela_botanica.client.modeles.ListeReferentielNom;
39 david 10
import org.tela_botanica.client.modeles.Observation;
13 david 11
import org.tela_botanica.client.modeles.ReferentielCommune;
20 david 12
import org.tela_botanica.client.modeles.ReferentielNom;
12 david 13
import org.tela_botanica.client.observation.ObservationMediateur;
14
 
15
 
71 jpm 16
import com.google.gwt.user.client.Window;
13 david 17
import com.gwtext.client.core.EventCallback;
18
import com.gwtext.client.core.EventObject;
19
import com.gwtext.client.core.ListenerConfig;
12 david 20
import com.gwtext.client.core.Position;
71 jpm 21
import com.gwtext.client.core.Template;
13 david 22
import com.gwtext.client.data.ArrayReader;
23
import com.gwtext.client.data.FieldDef;
24
import com.gwtext.client.data.MemoryProxy;
25
import com.gwtext.client.data.RecordDef;
71 jpm 26
import com.gwtext.client.data.SimpleStore;
13 david 27
import com.gwtext.client.data.Store;
28
import com.gwtext.client.data.StringFieldDef;
12 david 29
import com.gwtext.client.widgets.Button;
30
import com.gwtext.client.widgets.Panel;
71 jpm 31
import com.gwtext.client.widgets.Toolbar;
20 david 32
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
13 david 33
import com.gwtext.client.widgets.form.ComboBox;
12 david 34
import com.gwtext.client.widgets.form.DateField;
35
import com.gwtext.client.widgets.form.FormPanel;
74 david 36
import com.gwtext.client.widgets.form.Hidden;
12 david 37
import com.gwtext.client.widgets.form.TextField;
13 david 38
import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
12 david 39
import com.gwtext.client.widgets.layout.ColumnLayout;
40
import com.gwtext.client.widgets.layout.ColumnLayoutData;
41
import com.gwtext.client.widgets.layout.FormLayout;
13 david 42
import com.gwtext.client.data.Record;
12 david 43
 
44
/**
45
 * Panneau contenant les infos, les métadonnées et l'arbre des mots clés, il implémente l'interface rafraichissable
46
 * @author aurelien
47
 *
48
 */
13 david 49
public class FormulaireSaisieObservationVue extends Panel implements Rafraichissable  {
12 david 50
 
51
 
52
	/**
53
	 * Le médiateur associé à la vue
54
	 */
55
	private ObservationMediateur	observationMediateur		= null;
56
 
57
 
20 david 58
 
13 david 59
	private DateField date = null;
12 david 60
	private TextField lieudit = null;
61
	private TextField station = null;
62
	private TextField milieu = null;
63
	private TextField comment = null;
13 david 64
	private ComboBox  commune = null;
39 david 65
	private String departement = null;
20 david 66
	private ComboBox  espece = null;
39 david 67
	private String numeroNom = null;
74 david 68
	private String numeroOrdre = null;
20 david 69
 
74 david 70
 
71 jpm 71
	private Button boutonOK = new Button("Créer");
77 jpm 72
	private Button boutonAnnuler = new Button("Réinitialiser");
20 david 73
 
13 david 74
	private boolean selectionCommune=false;
20 david 75
	private boolean selectionEspece=false;
12 david 76
 
71 jpm 77
	private boolean modification = false ;
78
	private Toolbar bt = null ;
13 david 79
 
20 david 80
	private final int KEY_ALT = 18;
81
	private final int KEY_BACKSPACE = 8;
82
	private final int KEY_CTRL = 17;
83
	private final int KEY_DELETE = 46;
84
	private final int KEY_DOWN = 40;
85
	private final int KEY_END = 35;
86
	private final int KEY_ENTER = 13;
87
	private final int KEY_ESCAPE = 27;
88
	private final int KEY_HOME = 36;
89
	private final int KEY_LEFT = 37;
90
	private final int KEY_PAGEDOWN = 34;
91
	private final int KEY_PAGEUP = 33;
92
	private final int KEY_RIGHT = 39;
93
	private final int KEY_SHIFT = 16;
94
	private final int KEY_TAB = 9;
95
	private final int KEY_UP = 38;
13 david 96
 
71 jpm 97
	/**
98
	 * Combobox permettant de selectionner le mode
99
	 * modification ou bien création
100
	 */
101
	private ComboBox selecteurMode = new ComboBox();
13 david 102
 
71 jpm 103
	Store storeMode = null ;
13 david 104
 
12 david 105
	/**
106
	 * Booleen d'instanciation
107
	 */
108
	boolean estInstancie = false ;
109
 
110
	/**
111
	 * Constructeur sans argument (privé car ne doit pas être utilisé)
112
	 */
71 jpm 113
	@SuppressWarnings("unused")
12 david 114
	private FormulaireSaisieObservationVue()
115
	{
116
		super() ;
117
	}
118
 
119
	/**
120
	 * Constructeur avec argument
121
	 * @param im
122
	 */
123
	public FormulaireSaisieObservationVue(ObservationMediateur obs)
124
	{
125
 
126
 
127
		// on associe le médiateur
128
		observationMediateur = obs ;
129
 
130
 
53 david 131
		setHeader(true);
12 david 132
 
133
		FormPanel panneauFormulaire = new FormPanel(Position.RIGHT);
134
		panneauFormulaire.setBorder(false);
135
 
136
		// Panneau intermediaire qui contient deux colonnes de formulaire
137
 
138
		Panel panneauIntermediaire = new Panel();
139
		panneauIntermediaire.setLayout(new ColumnLayout());
140
		panneauIntermediaire.setBorder(false);
141
 
142
		//create first panel and add fields to it
143
		Panel panneauPremierColonne = new Panel();
144
		panneauPremierColonne.setLayout(new FormLayout());
145
		panneauPremierColonne.setBorder(false);
146
 
147
		//create second panel and add fields to it
148
	    Panel panneauSecondeColonne = new Panel();
149
		panneauSecondeColonne.setLayout(new FormLayout());
150
		panneauSecondeColonne.setBorder(false);
42 jpm 151
 
152
		this.setPaddings(5) ;
12 david 153
 
20 david 154
 
49 david 155
 
13 david 156
		commune=new ComboBox("Commune","commune",275 );
157
 
158
 
20 david 159
		final String resultTplCommune = "<div class=\"search-item-commune\">{commune}</div>";
13 david 160
 
161
 
20 david 162
		commune.setTpl(resultTplCommune);
13 david 163
		commune.setMode(ComboBox.REMOTE);
164
		// commune.setPageSize(10); // Ne fonctionne pas
20 david 165
		commune.setItemSelector("div.search-item-commune");
13 david 166
		commune.setTypeAhead(true);
167
		commune.setLoadingText("Recherche...");
168
 
169
		commune.setHideTrigger(true);
170
 
171
 
20 david 172
 
13 david 173
 
174
 
175
	    panneauPremierColonne.add(commune);
176
 
177
 
178
 
12 david 179
	    station = new TextField("Station", "station", 275);
180
	    station.setAllowBlank(true);
181
	    panneauPremierColonne.add(station);
182
 
183
	    date = new DateField("Date", "date", 100);
184
	    date.setAllowBlank(true);
20 david 185
	    date.setFormat("d/m/Y") ;
12 david 186
	    panneauPremierColonne.add(date);
20 david 187
 
188
 
189
		espece=new ComboBox("Espèce","nom",275 );
12 david 190
 
20 david 191
 
192
		final String resultTplEspece = "<div class=\"search-item-espece\">{nom}</div>";
193
 
194
 
195
		espece.setTpl(resultTplEspece);
196
		espece.setMode(ComboBox.REMOTE);
197
		// commune.setPageSize(10); // Ne fonctionne pas
198
		espece.setItemSelector("div.search-item-espece");
199
		espece.setTypeAhead(true);
200
		espece.setLoadingText("Recherche...");
201
 
202
		espece.setHideTrigger(true);
203
 
204
 
205
 
206
	    panneauPremierColonne.add(espece);
207
 
12 david 208
	    comment = new TextField("Notes", "comment", 275);
209
	    comment.setAllowBlank(true);
210
	    panneauPremierColonne.add(comment);
211
 
212
 
213
	    lieudit = new TextField("Lieu-dit", "lieudit", 275);
214
	    lieudit.setAllowBlank(true);
215
	    panneauSecondeColonne.add(lieudit);
216
 
217
 
218
	    milieu = new TextField("Milieu", "milieu", 275);
219
	    milieu.setAllowBlank(true);
220
	    panneauSecondeColonne.add(milieu);
221
 
13 david 222
 
12 david 223
 
224
		panneauIntermediaire.add(panneauPremierColonne, new ColumnLayoutData(.5));
225
		panneauIntermediaire.add(panneauSecondeColonne, new ColumnLayoutData(.5));
226
 
227
		panneauFormulaire.add(panneauIntermediaire);
228
 
71 jpm 229
		Object[][] mode = {{"création",false} , {"modification", true} };
230
		storeMode = new SimpleStore(new String[] { "nom_mode", "mode" },
231
				mode);
232
		storeMode.load();
233
		selecteurMode.setStore(storeMode);
234
		selecteurMode.setDisplayField("nom_mode") ;
235
		selecteurMode.setLabel("mode ") ;
236
		selecteurMode.setForceSelection(true) ;
237
		selecteurMode.setValue("création") ;
238
		selecteurMode.setEditable(false) ;
97 jpm 239
		selecteurMode.setCls("x-selec-crea") ;
71 jpm 240
 
241
		bt = new Toolbar() ;
242
		bt.addSpacer() ;
243
		bt.addText("Mode de saisie ") ;
244
		bt.addField(selecteurMode) ;
245
 
74 david 246
 
247
 
248
 
12 david 249
		panneauFormulaire.addButton(boutonOK);
250
 
251
		panneauFormulaire.addButton(boutonAnnuler);
71 jpm 252
 
253
		selecteurMode.addListener(new ComboBoxListenerAdapter() {
254
 
255
			public void onSelect(ComboBox comboBox, Record record, int index) {
256
 
257
				// et on met la valeur à jour dans la combobox
258
				comboBox.setValue(record.getAsString("nom_mode"));
259
				setModification(record.getAsString("mode")) ;
260
			}
261
 
262
		});
12 david 263
 
264
		this.add(panneauFormulaire) ;
80 jpm 265
		this.setTopToolbar(bt) ;
12 david 266
 
267
 
268
		this.setAutoHeight(true);
269
 
270
 
271
		// on ajoute les listeners
272
		ajouterListeners() ;
273
 
274
 
275
 
276
	}
277
 
278
	private void ajouterListeners()
94 jpm 279
	{
20 david 280
		// Listener completion communne
281
 
282
		   commune.addListener(new ComboBoxListenerAdapter() {
283
	             public void onSelect(ComboBox comboBox, Record record, int index) {
284
	                 commune.setValue(record.getAsString("commune"));
39 david 285
	                 departement=record.getAsString("departement");
20 david 286
	                 selectionCommune=true;
287
	             }
288
	         });
289
 
290
 
291
			ListenerConfig listenerConfigCommune=new ListenerConfig();
292
			listenerConfigCommune.setDelay(10);
293
			listenerConfigCommune.setStopPropagation(false);
294
			listenerConfigCommune.setStopEvent(false);
295
 
296
 
297
 
298
		    commune.addKeyPressListener(new EventCallback()	{
299
 
300
		    	    public void execute(EventObject e) {
301
 
302
 
303
		    	    		  switch(e.getKey()) {
304
 
305
 
306
		    	    		  case KEY_ALT:
307
		    	    	      case KEY_CTRL:
308
		    	    	      case KEY_DOWN:
309
		    	    	      case KEY_END:
310
		    	    	      case KEY_ESCAPE:
311
		    	    	      case KEY_HOME:
312
		    	    	      case KEY_LEFT:
313
		    	    	      case KEY_PAGEDOWN:
314
		    	    	      case KEY_PAGEUP:
315
		    	    	      case KEY_RIGHT:
316
		    	    	      case KEY_SHIFT:
317
		    	    	      case KEY_TAB:
318
		    	    	      case KEY_UP:
319
 
320
		    	    	        break;
321
 
322
		    	    	      case KEY_ENTER:
323
 
324
		    	    	    	 if (selectionCommune) {
325
		    	    	    		 selectionCommune=false;
326
		    	    	    	 }
327
		    	    	    	 else {
328
		    	    	    		// lancer mise a jour
329
		    	    	    	 }
330
 
331
 
332
		    	    	    	  break;
333
 
334
		    	    	      default:
335
 
83 david 336
		    	    	    	  departement="";
20 david 337
		    	    	    	  obtenirListeReferentielCommune();
338
 
339
		    	    	        break;
340
		    	    	    }
341
 
342
 
343
 
344
		     		}
345
 
346
		    		},    listenerConfigCommune
347
 
348
			);
349
 
350
			// Listener completion espece
351
 
352
 
353
			espece.addListener(new ComboBoxListenerAdapter() {
354
	             public void onSelect(ComboBox comboBox, Record record, int index) {
355
	            	 espece.setValue(record.getAsString("nom"));
39 david 356
	            	 numeroNom=record.getAsString("numeroNom");
20 david 357
	                 selectionEspece=true;
358
	             }
359
	         });
360
 
361
 
362
			ListenerConfig listenerConfigEspece=new ListenerConfig();
363
			listenerConfigEspece.setDelay(10);
364
			listenerConfigEspece.setStopPropagation(false);
365
			listenerConfigEspece.setStopEvent(false);
366
 
367
 
368
			espece.addKeyPressListener(new EventCallback()	{
369
 
370
		    	    public void execute(EventObject e) {
371
 
372
 
373
		    	    		  switch(e.getKey()) {
374
 
375
 
376
		    	    		  case KEY_ALT:
377
		    	    	      case KEY_CTRL:
378
		    	    	      case KEY_DOWN:
379
		    	    	      case KEY_END:
380
		    	    	      case KEY_ESCAPE:
381
		    	    	      case KEY_HOME:
382
		    	    	      case KEY_LEFT:
383
		    	    	      case KEY_PAGEDOWN:
384
		    	    	      case KEY_PAGEUP:
385
		    	    	      case KEY_RIGHT:
386
		    	    	      case KEY_SHIFT:
387
		    	    	      case KEY_TAB:
388
		    	    	      case KEY_UP:
389
 
390
		    	    	        break;
391
 
392
		    	    	      case KEY_ENTER:
393
 
394
		    	    	    	 if (selectionEspece) {
395
		    	    	    		 selectionEspece=false;
396
		    	    	    	 }
397
		    	    	    	 else {
398
		    	    	    		// lancer mise a jour
399
		    	    	    	 }
400
 
401
 
402
		    	    	    	  break;
403
 
404
		    	    	      default:
405
 
83 david 406
		    	    	    	  numeroNom="";
20 david 407
		    	    	    	  obtenirListeReferentielNom();
408
 
409
		    	    	        break;
410
		    	    	    }
411
 
412
 
413
 
414
		     		}
415
 
416
		    		},    listenerConfigEspece
417
 
418
			);
419
 
420
 
421
 
422
 
423
		boutonOK.addListener(new ButtonListenerAdapter() {
39 david 424
 
20 david 425
			public void onClick(Button button, EventObject e) {
39 david 426
 
71 jpm 427
				if(modification)
428
				{
429
					modifierObservation() ;
430
				}
431
				else
432
				{
433
					ajouterObservation();
434
				}
39 david 435
 
71 jpm 436
 
20 david 437
			}
438
 
439
		});
77 jpm 440
 
441
		boutonAnnuler.addListener(new ButtonListenerAdapter() {
12 david 442
 
443
			public void onClick(Button button, EventObject e) {
444
 
77 jpm 445
				if(modification)
446
				{
447
					supprimerObservation() ;
448
				}
449
				else
450
				{
104 jpm 451
					raz();
77 jpm 452
				}
12 david 453
 
77 jpm 454
 
455
			}
456
 
12 david 457
		});
458
 
459
 
460
	}
461
 
462
	/**
463
	 * Desactive visuellement ce panneau
464
	 */
465
	public void desactiverPanneau()
466
	{
467
		this.setDisabled(true) ;
468
	}
469
 
470
	/**
471
	 * Active visuellement ce panneau
472
	 */
473
	public void activerPanneau()
474
	{
475
		this.setDisabled(false) ;
476
	}
13 david 477
 
478
	public void rafraichir(Object nouvelleDonnees, boolean repandreRaffraichissement) {
479
 
49 david 480
		// si l'on a reçu une liste du referentiel commune (completion referentiel commune)
13 david 481
			if(nouvelleDonnees instanceof ListeReferentielCommune)
482
			{
483
 
484
					ListeReferentielCommune data = (ListeReferentielCommune) nouvelleDonnees ;
485
					Object[][] communeData = new Object[data.size()][2];
486
					int i = 0 ;
487
 
488
					// on la parse et on récupère les informations quiç nous interessent
489
					for (Iterator it = data.keySet().iterator(); it.hasNext();)
490
					{
491
 
492
						ReferentielCommune ref=(ReferentielCommune) data.get(it.next());
493
 
494
						communeData[i][0]= ref.getCommune();
495
						communeData[i][1]= ref.getDepartement();
496
 
497
 
498
						i++ ;
499
					}
500
 
501
					   //	  creation du store
502
					FieldDef defCommune = new StringFieldDef("commune");
503
					FieldDef defDepartement = new StringFieldDef("departement");
504
 
505
 
506
					FieldDef[] defTab = { defCommune, defDepartement};
507
 
508
					RecordDef rd = new RecordDef(defTab);
509
 
510
					final MemoryProxy dataProxy = new MemoryProxy(communeData);
511
					final ArrayReader reader = new ArrayReader(rd);
512
 
20 david 513
					Store store=new Store(dataProxy,reader);
13 david 514
					store.load() ;
515
 
41 jpm 516
					commune.setStore(store);
13 david 517
 
518
			}
20 david 519
 
94 jpm 520
			//			 si l'on a reçu une liste du référentiel nom (complétion referentiel nom)
20 david 521
 
522
			if(nouvelleDonnees instanceof ListeReferentielNom)
523
			{
524
 
525
					ListeReferentielNom data = (ListeReferentielNom) nouvelleDonnees ;
526
					Object[][] nomData = new Object[data.size()][2];
527
					int i = 0 ;
528
 
529
					// on la parse et on récupère les informations quiç nous interessent
530
					for (Iterator it = data.keySet().iterator(); it.hasNext();)
531
					{
532
 
533
						ReferentielNom ref=(ReferentielNom) data.get(it.next());
534
 
535
						nomData[i][0]= ref.getNom();
536
						nomData[i][1]= ref.getNumeroNom();
537
 
538
 
539
						i++ ;
540
					}
541
 
542
					   //	  creation du store
543
					FieldDef defNom = new StringFieldDef("nom");
544
					FieldDef defNumeroNom = new StringFieldDef("numeroNom");
545
 
546
 
547
					FieldDef[] defTab = { defNom, defNumeroNom};
548
 
549
					RecordDef rd = new RecordDef(defTab);
550
 
551
					final MemoryProxy dataProxy = new MemoryProxy(nomData);
552
					final ArrayReader reader = new ArrayReader(rd);
553
 
554
					Store store=new Store(dataProxy,reader);
555
					store.load() ;
556
 
557
					espece.setStore(store);
558
 
559
 
560
 
561
			}
562
 
82 david 563
			// On recoit une observation dont on veut afficher le detail
564
 
71 jpm 565
			if(nouvelleDonnees instanceof Observation)
566
			{
567
				Observation obs = (Observation)nouvelleDonnees ;
568
				afficherDetailsObservation(obs) ;
569
			}
77 jpm 570
 
82 david 571
			// Sur Mise à jour ou suppression d'une suppression ?
572
 
77 jpm 573
			if(nouvelleDonnees instanceof String)
574
			{
575
				String str = (String)nouvelleDonnees ;
576
				observationMediateur.obtenirListeObservation() ;
577
			}
20 david 578
 
13 david 579
	}
12 david 580
 
581
 
13 david 582
	public void obtenirListeReferentielCommune() {
94 jpm 583
 
20 david 584
	 String com=commune.getText().replaceAll(" ","/");
585
	 com=com.replaceAll("%","");
586
 
587
	 observationMediateur.obtenirListeReferentielCommune(this,com);
13 david 588
 
589
	}
20 david 590
 
591
 
592
	public void obtenirListeReferentielNom() {
593
 
594
	  String esp=espece.getText().replaceAll(" ","/");
595
	  esp=esp.replaceAll("%","");
596
 
597
	  observationMediateur.obtenirListeReferentielNom(this,esp);
598
 
599
	}
600
 
601
 
39 david 602
	public void ajouterObservation() {
603
 
77 jpm 604
		Observation obs=new Observation(espece.getText(),numeroNom,commune.getText(),departement,lieudit.getText(),station.getText(),milieu.getText(), comment.getText(),date.getRawValue());
46 david 605
		observationMediateur.ajouterObservation(obs);
39 david 606
	}
12 david 607
 
71 jpm 608
	private void modifierObservation() {
609
 
79 david 610
		Observation obs=new Observation(espece.getText(),numeroNom,commune.getText(),departement,lieudit.getText(),station.getText(),milieu.getText(), comment.getText(),date.getText());
611
		obs.setNumeroOrdre(numeroOrdre);
612
		observationMediateur.modifierObservation(obs);
74 david 613
 
71 jpm 614
	}
77 jpm 615
 
616
	private void supprimerObservation() {
617
 
618
			observationMediateur.supprimerObservation(this, numeroOrdre);
619
	}
12 david 620
 
71 jpm 621
 
622
	public void afficherDetailsObservation(Observation obs)
623
	{
104 jpm 624
		raz() ;
71 jpm 625
 
626
		if(!obs.getDate().equals("null") && !obs.getDate().equals("000null")) {
627
			String[] dateEtHeure = obs.getDate().split(" ", 2);
77 jpm 628
			date.setValue(dateEtHeure[0]) ;
71 jpm 629
		}
630
		if(!obs.getLieudit().equals("null") && !obs.getLieudit().equals("000null")) {
631
			lieudit.setValue(obs.getLieudit()) ;
632
		}
633
		if(!obs.getStation().equals("null") && !obs.getStation().equals("000null")) {
634
			station.setValue(obs.getStation()) ;
635
		}
636
		if(!obs.getMilieu().equals("null") && !obs.getMilieu().equals("000null")) {
637
			milieu.setValue(obs.getMilieu()) ;
638
		}
639
		if(!obs.getCommentaire().equals("null") && !obs.getCommentaire().equals("000null")) {
640
			comment.setValue(obs.getCommentaire()) ;
641
		}
642
		if(!obs.getLocalite().equals("null") && !obs.getLocalite().equals("000null")) {
643
			commune.setValue(obs.getLocalite()) ;
644
		}
645
		if(!obs.getIdentifiantLocalite().equals("null") && !obs.getIdentifiantLocalite().equals("000null")) {
646
			departement = obs.getIdentifiantLocalite();
647
		}
648
		if(!obs.getNomSaisi().equals("null") && !obs.getNomSaisi().equals("000null")) {
649
			espece.setValue(obs.getNomSaisi()) ;
650
		}
651
		if(!obs.getNumeroNomenclaturalSaisi().equals("null") && !obs.getNumeroNomenclaturalSaisi().equals("000null")) {
652
			numeroNom = obs.getNumeroNomenclaturalSaisi() ;
653
		}
83 david 654
		if(!obs.getNumeroOrdre().equals("null") && !obs.getNumeroOrdre().equals("000nu2ll")) {
74 david 655
			numeroOrdre = obs.getNumeroOrdre() ;
656
		}
657
 
71 jpm 658
	}
659
 
104 jpm 660
	public void raz()
71 jpm 661
	{
662
 
663
		date.reset() ;
664
		lieudit.reset() ;
665
		station.reset() ;
666
		milieu.reset();
667
		comment.reset();
668
		commune.reset();
669
		departement = "";
670
		espece.reset();
671
		numeroNom = "" ;
74 david 672
		numeroOrdre = "";
71 jpm 673
 
674
	}
675
 
676
	private void setModification(String mode)
677
	{
678
		if(mode.equals("true")) {
679
 
680
			boutonOK.setText("Modifier") ;
681
			setTitle("Modification") ;
77 jpm 682
			boutonAnnuler.setText("Supprimer") ;
71 jpm 683
			modification = true ;
97 jpm 684
			selecteurMode.removeClass("x-selec-crea") ;
685
			selecteurMode.setCls("x-selec-modif") ;
94 jpm 686
 
71 jpm 687
		}
688
		else
689
		{
690
 
691
			boutonOK.setText("Créer") ;
692
			setTitle("Saisir") ;
77 jpm 693
			boutonAnnuler.setText("Réinitialiser") ;
71 jpm 694
			modification = false ;
97 jpm 695
			selecteurMode.removeClass("x-selec-modif") ;
696
			selecteurMode.setCls("x-selec-crea") ;
94 jpm 697
 
71 jpm 698
		}
699
 
700
	}
701
 
702
 
703
	/**
704
	 * renvoie vrai si on est en mode modification, faux si on est en mode création
705
	 * @return
706
	 */
707
	public boolean getModification()
708
	{
709
		return modification ;
710
	}
711
 
12 david 712
}