Subversion Repositories eFlore/Applications.coel

Rev

Rev 865 | Rev 875 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 865 Rev 867
Line 31... Line 31...
31
import com.google.gwt.core.client.GWT;
31
import com.google.gwt.core.client.GWT;
32
import com.google.gwt.i18n.client.NumberFormat;
32
import com.google.gwt.i18n.client.NumberFormat;
Line 33... Line 33...
33
 
33
 
Line -... Line 34...
-
 
34
public class CollectionFormGeneral extends FormulaireOnglet implements Rafraichissable {
-
 
35
	
-
 
36
	private Collection collection = null;
34
public class CollectionFormGeneral extends FormulaireOnglet implements Rafraichissable {
37
	private Collection collectionCollectee = null;
Line 35... Line 38...
35
	
38
 
36
	private HiddenField<String> idCollectionChp;
39
	private HiddenField<String> idCollectionChp;
37
	
40
	
Line 45... Line 48...
45
	private ChampComboBoxListeValeurs specimenTypeCombo = null;
48
	private ChampComboBoxListeValeurs specimenTypeCombo = null;
46
	private ChampComboBoxListeValeurs precisionTypeNbreCombo = null;
49
	private ChampComboBoxListeValeurs precisionTypeNbreCombo = null;
47
	private NumberField nbreTypeChp = null;
50
	private NumberField nbreTypeChp = null;
48
	private ChampComboBoxListeValeurs classementSpecimenTypeCombo;
51
	private ChampComboBoxListeValeurs classementSpecimenTypeCombo;
Line 49... Line 52...
49
	
52
	
50
	private ComboBox<Valeur> typeDepotCombo = null;
53
	private ChampComboBoxListeValeurs typeDepotCombo = null;
51
	private TextField<String> coteChp = null;
54
	private TextField<String> coteChp = null;
52
	private ChampMultiValeurs idAlternatifsChp = null;
55
	private ChampMultiValeurs idAlternatifsChp = null;
53
	private ChampMultiValeurs nomsAlternatifsChp = null;
56
	private ChampMultiValeurs nomsAlternatifsChp = null;
Line 63... Line 66...
63
	public CollectionFormGeneral(Formulaire formulaireCourrant) {
66
	public CollectionFormGeneral(Formulaire formulaireCourrant) {
64
		initialiserOnglet(formulaireCourrant);
67
		initialiserOnglet(formulaireCourrant);
65
		setId("general");
68
		setId("general");
66
		setText(Mediateur.i18nC.collectionGeneral());
69
		setText(Mediateur.i18nC.collectionGeneral());
Line -... Line 70...
-
 
70
		
-
 
71
		collection = ((CollectionForm) formulaire).collection;
-
 
72
		collectionCollectee = ((CollectionForm) formulaire).collectionCollectee;
67
		
73
		
68
		creerChampsCache();
74
		creerChampsCache();
69
		creerFieldsetLiaison();
75
		creerFieldsetLiaison();
70
		creerFieldsetAdministratif();
76
		creerFieldsetAdministratif();
71
		creerFieldsetDescription();
77
		creerFieldsetDescription();
Line 264... Line 270...
264
		typeFieldSet.add(infoType);
270
		typeFieldSet.add(infoType);
Line 265... Line 271...
265
		
271
		
266
		this.add(typeFieldSet);
272
		this.add(typeFieldSet);
Line -... Line 273...
-
 
273
	}
-
 
274
	
-
 
275
	public void peupler() {
-
 
276
		if (collection != null) {
-
 
277
			idCollectionChp.setValue(collection.getId());
-
 
278
			
-
 
279
			typeDepotCombo.peupler(collection.getTypeDepot());
-
 
280
			coteChp.setValue(collection.getCote());
-
 
281
			idAlternatifsChp.peupler(collection.getIdAlternatif());
-
 
282
			nomsAlternatifsChp.peupler(collection.getNomAlternatif());
-
 
283
			codesAlternatifsChp.peupler(collection.getCode());
-
 
284
			
-
 
285
			descriptionChp.setValue(collection.getDescription());
-
 
286
			descriptionSpecialisteChp.setValue(collection.getDescriptionSpecialiste());
-
 
287
			historiqueChp.setValue(collection.getHistorique());
-
 
288
			urlsChp.peupler(collection.getUrls());
-
 
289
			
-
 
290
			groupementPrincipeCombo.peupler(collection.getGroupementPrincipe());
-
 
291
			butRealisationCombo.peupler(collection.getGroupementBut());
-
 
292
			lieuCouvertureChp.peupler(collection.getCouvertureLieu());
-
 
293
			
-
 
294
			specimenTypeCombo.peupler(collection.getSpecimenType());
-
 
295
			nbreTypeChp.setValue(Integer.parseInt(collection.getSpecimenTypeNbre()));
-
 
296
			precisionTypeNbreCombo.peupler(collection.getSpecimenTypeNbrePrecision());
-
 
297
			classementSpecimenTypeCombo.peupler(collection.getSpecimenTypeClassement());
-
 
298
		}
-
 
299
	}
-
 
300
	
-
 
301
	public void collecter() {
-
 
302
		if (etreAccede()) {
-
 
303
			collectionCollectee.setId(idCollectionChp.getValue());
-
 
304
			
-
 
305
			collectionCollectee.setTypeDepot(typeDepotCombo.getValeur());
-
 
306
			collectionCollectee.setCote(coteChp.getValue());
-
 
307
			collectionCollectee.setIdAlternatif(idAlternatifsChp.getValeurs());
-
 
308
			collectionCollectee.setNomAlternatif(nomsAlternatifsChp.getValeurs());
-
 
309
			collectionCollectee.setCode(codesAlternatifsChp.getValeurs());
-
 
310
			
-
 
311
			collectionCollectee.setDescription(descriptionChp.getValue());
-
 
312
			collectionCollectee.setDescriptionSpecialiste(descriptionSpecialisteChp.getValue());
-
 
313
			collectionCollectee.setHistorique(historiqueChp.getValue());
-
 
314
			collectionCollectee.setUrls(urlsChp.getValeurs());
-
 
315
			
-
 
316
			collectionCollectee.setGroupementPrincipe(groupementPrincipeCombo.getValeur());
-
 
317
			collectionCollectee.setGroupementBut(butRealisationCombo.getValeur());
-
 
318
			collectionCollectee.setCouvertureLieu(lieuCouvertureChp.getValeurs());
-
 
319
			
-
 
320
			collectionCollectee.setSpecimenType(specimenTypeCombo.getValeur());
-
 
321
			collectionCollectee.setSpecimenTypeNbre(nbreTypeChp.getValue().toString());
-
 
322
			collectionCollectee.setSpecimenTypeNbrePrecision(precisionTypeNbreCombo.getValeur());
-
 
323
			collectionCollectee.setSpecimenTypeClassement(classementSpecimenTypeCombo.getValeur());
-
 
324
		}
-
 
325
	}
-
 
326
	
-
 
327
	private void mettreAJourValeurComboProjets() {
-
 
328
		if (projetsCombo.getStore() != null && collection != null) {
-
 
329
			projetsCombo.setValue(projetsCombo.getStore().findModel("id_projet", collection.getIdProjet()));
-
 
330
		}
-
 
331
	}
-
 
332
	
-
 
333
	private void mettreAJourValeurComboStructures() {
-
 
334
		if (structuresCombo.getStore() != null && collection != null) {
-
 
335
			structuresCombo.setValue(structuresCombo.getStore().findModel("id_structure", collection.getIdStructure()));
-
 
336
		}
-
 
337
	}
-
 
338
	
-
 
339
	private void mettreAJourValeurComboCollections() {
-
 
340
		if (collectionsCombo.getStore() != null && collection != null) {
-
 
341
			collectionsCombo.setValue(collectionsCombo.getStore().findModel("id_collection", collection.getCollectionMereId()));
-
 
342
		}
267
	}
343
	}
268
	
344
	
269
	public void rafraichir(Object nouvellesDonnees) {
345
	public void rafraichir(Object nouvellesDonnees) {
270
		if (nouvellesDonnees instanceof ProjetListe) {
346
		if (nouvellesDonnees instanceof ProjetListe) {
-
 
347
			ProjetListe projets = (ProjetListe) nouvellesDonnees;
271
			ProjetListe projets = (ProjetListe) nouvellesDonnees;
348
			Formulaire.rafraichirComboBox(projets, projetsCombo);
272
			Formulaire.rafraichirComboBox(projets, projetsCombo);
349
			mettreAJourValeurComboProjets();
273
		} else if (nouvellesDonnees instanceof StructureListe) {
350
		} else if (nouvellesDonnees instanceof StructureListe) {
-
 
351
			StructureListe structures = (StructureListe) nouvellesDonnees;
274
			StructureListe structures = (StructureListe) nouvellesDonnees;
352
			Formulaire.rafraichirComboBox(structures, structuresCombo);
275
			Formulaire.rafraichirComboBox(structures, structuresCombo);
353
			mettreAJourValeurComboStructures();
276
		} else if (nouvellesDonnees instanceof CollectionListe) {
354
		} else if (nouvellesDonnees instanceof CollectionListe) {
-
 
355
			CollectionListe collections = (CollectionListe) nouvellesDonnees;
277
			CollectionListe collections = (CollectionListe) nouvellesDonnees;
356
			Formulaire.rafraichirComboBox(collections, collectionsCombo);
278
			Formulaire.rafraichirComboBox(collections, collectionsCombo);
357
			mettreAJourValeurComboCollections();
279
		} else if (nouvellesDonnees instanceof ValeurListe) {
358
		} else if (nouvellesDonnees instanceof ValeurListe) {
280
			ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
359
			ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
281
			rafraichirValeurListe(listeValeurs);
360
			rafraichirValeurListe(listeValeurs);