Subversion Repositories eFlore/Applications.coel

Rev

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

Rev Author Line No. Line
934 jpm 1
package org.tela_botanica.client.vues.collection;
687 jp_milcent 2
 
875 jpm 3
import java.util.ArrayList;
4
 
975 jpm 5
import org.tela_botanica.client.ComposantClass;
687 jp_milcent 6
import org.tela_botanica.client.Mediateur;
1018 jpm 7
import org.tela_botanica.client.composants.ChampCaseACocher;
859 jpm 8
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
1327 cyprien 9
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
687 jp_milcent 10
import org.tela_botanica.client.composants.ChampMultiValeurs;
1327 cyprien 11
import org.tela_botanica.client.composants.ChampMultiValeursMultiTypesPaginable;
859 jpm 12
import org.tela_botanica.client.composants.ConteneurMultiChamps;
1327 cyprien 13
import org.tela_botanica.client.composants.pagination.ProxyCollections;
14
import org.tela_botanica.client.composants.pagination.ProxyProjets;
15
import org.tela_botanica.client.composants.pagination.ProxyStructures;
16
import org.tela_botanica.client.composants.pagination.ProxyValeur;
687 jp_milcent 17
import org.tela_botanica.client.interfaces.Rafraichissable;
18
import org.tela_botanica.client.modeles.ValeurListe;
935 jpm 19
import org.tela_botanica.client.modeles.collection.Collection;
20
import org.tela_botanica.client.modeles.collection.CollectionListe;
21
import org.tela_botanica.client.modeles.projet.Projet;
22
import org.tela_botanica.client.modeles.projet.ProjetListe;
23
import org.tela_botanica.client.modeles.structure.Structure;
24
import org.tela_botanica.client.modeles.structure.StructureListe;
951 jpm 25
import org.tela_botanica.client.util.Debug;
934 jpm 26
import org.tela_botanica.client.vues.Formulaire;
27
import org.tela_botanica.client.vues.FormulaireOnglet;
858 jpm 28
 
1327 cyprien 29
import com.extjs.gxt.ui.client.data.ModelData;
30
import com.extjs.gxt.ui.client.data.ModelType;
968 jpm 31
import com.extjs.gxt.ui.client.event.BaseEvent;
32
import com.extjs.gxt.ui.client.event.Events;
33
import com.extjs.gxt.ui.client.event.Listener;
687 jp_milcent 34
import com.extjs.gxt.ui.client.store.ListStore;
859 jpm 35
import com.extjs.gxt.ui.client.util.Margins;
36
import com.extjs.gxt.ui.client.widget.Text;
687 jp_milcent 37
import com.extjs.gxt.ui.client.widget.form.ComboBox;
38
import com.extjs.gxt.ui.client.widget.form.Field;
39
import com.extjs.gxt.ui.client.widget.form.FieldSet;
40
import com.extjs.gxt.ui.client.widget.form.HiddenField;
859 jpm 41
import com.extjs.gxt.ui.client.widget.form.NumberField;
687 jp_milcent 42
import com.extjs.gxt.ui.client.widget.form.TextArea;
862 jpm 43
import com.extjs.gxt.ui.client.widget.form.TextField;
687 jp_milcent 44
import com.extjs.gxt.ui.client.widget.form.Validator;
45
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
46
import com.extjs.gxt.ui.client.widget.layout.FormData;
859 jpm 47
import com.extjs.gxt.ui.client.widget.layout.HBoxLayoutData;
48
import com.google.gwt.i18n.client.NumberFormat;
687 jp_milcent 49
 
50
public class CollectionFormGeneral extends FormulaireOnglet implements Rafraichissable {
51
 
1083 jpm 52
	public static final String ID = "general";
867 jpm 53
	private Collection collection = null;
54
	private Collection collectionCollectee = null;
55
 
1018 jpm 56
	private HiddenField<String> idCollectionChp = null;
687 jp_milcent 57
 
1327 cyprien 58
	private ChampComboBoxRechercheTempsReelPaginable projetsCombo = null;
59
	private ChampComboBoxRechercheTempsReelPaginable structuresCombo = null;
60
	private ChampComboBoxRechercheTempsReelPaginable collectionsCombo = null;
858 jpm 61
 
1018 jpm 62
	private ChampCaseACocher periodeConstitutionChp = null;
63
	private ChampComboBoxListeValeurs groupementPrincipeCombo = null;
862 jpm 64
	private ChampMultiValeurs lieuCouvertureChp = null;
687 jp_milcent 65
 
859 jpm 66
	private ChampComboBoxListeValeurs specimenTypeCombo = null;
67
	private ChampComboBoxListeValeurs precisionTypeNbreCombo = null;
68
	private NumberField nbreTypeChp = null;
1018 jpm 69
	private ChampComboBoxListeValeurs classementSpecimenTypeCombo = null;
858 jpm 70
 
867 jpm 71
	private ChampComboBoxListeValeurs typeDepotCombo = null;
865 jpm 72
	private TextField<String> coteChp = null;
73
	private ChampMultiValeurs idAlternatifsChp = null;
74
	private ChampMultiValeurs nomsAlternatifsChp = null;
75
	private ChampMultiValeurs codesAlternatifsChp = null;
862 jpm 76
 
865 jpm 77
	private TextArea descriptionSpecialisteChp = null;
78
	private TextArea descriptionChp = null;
79
	private TextArea historiqueChp = null;
80
	private ChampMultiValeurs urlsChp = null;
862 jpm 81
 
865 jpm 82
	private ChampComboBoxListeValeurs butRealisationCombo = null;
862 jpm 83
 
687 jp_milcent 84
	public CollectionFormGeneral(Formulaire formulaireCourrant) {
85
		initialiserOnglet(formulaireCourrant);
1083 jpm 86
		setId(ID);
687 jp_milcent 87
		setText(Mediateur.i18nC.collectionGeneral());
88
 
89
		creerChampsCache();
90
		creerFieldsetLiaison();
91
		creerFieldsetAdministratif();
92
		creerFieldsetDescription();
858 jpm 93
		creerFieldsetCouverture();
859 jpm 94
		creerFieldsetType();
687 jp_milcent 95
	}
96
 
875 jpm 97
	private void initialiserCollection() {
98
		collection = ((CollectionForm) formulaire).collection;
99
		collectionCollectee = ((CollectionForm) formulaire).collectionCollectee;
100
	}
101
 
687 jp_milcent 102
	private void creerChampsCache() {
103
		// Champs cachés
104
		idCollectionChp = new HiddenField<String>();
105
		this.add(idCollectionChp);
106
	}
107
 
108
	private void creerFieldsetLiaison() {
109
		FieldSet liaisonFieldSet = new FieldSet();
110
		liaisonFieldSet.setHeading(i18nC.liaisonTitreCollection());
111
		liaisonFieldSet.setCollapsible(true);
858 jpm 112
		liaisonFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
687 jp_milcent 113
 
1327 cyprien 114
 
115
		/*********************************/
116
		/**			Champ Projets		**/
117
		/*********************************/
118
 
119
		ModelType modelTypeProjets = new ModelType();
120
		modelTypeProjets.setRoot("projets");
121
		modelTypeProjets.setTotalName("nbElements");
122
		modelTypeProjets.addField("cpr_nom");
123
		modelTypeProjets.addField("cpr_id_projet");
124
 
125
		String displayNameProjets = "cpr_nom";
126
		ProxyProjets<ModelData> proxyProjets = new ProxyProjets<ModelData>();
127
 
128
		projetsCombo = new ChampComboBoxRechercheTempsReelPaginable(proxyProjets, modelTypeProjets, displayNameProjets);
1359 cyprien 129
		projetsCombo.setWidth(250, 650);
1327 cyprien 130
		projetsCombo.getCombo().setTabIndex(tabIndex++);
131
		projetsCombo.getCombo().setFieldLabel(i18nC.projetChamp());
132
		projetsCombo.getCombo().setForceSelection(true);
133
		projetsCombo.getCombo().addStyleName(ComposantClass.OBLIGATOIRE);
134
		projetsCombo.getCombo().addListener(Events.Valid, Formulaire.creerEcouteurChampObligatoire());
135
 
136
		projetsCombo.getCombo().setValidator(new Validator() {
687 jp_milcent 137
			public String validate(Field<?> field, String value) {
138
				String retour = null;
139
				if (field.getRawValue().equals("")) {
140
					field.setValue(null);
1327 cyprien 141
				} else if (projetsCombo.getStore().findModel("cpr_nom", field.getRawValue()) == null) {
687 jp_milcent 142
					String contenuBrut = field.getRawValue();
143
					field.setValue(null);
144
					field.setRawValue(contenuBrut);
145
					retour = "Veuillez sélectionner une valeur ou laisser le champ vide";
146
				}
147
				return retour;
148
			}
149
		});
1327 cyprien 150
 
151
		liaisonFieldSet.add(projetsCombo, new FormData(600, 0));
687 jp_milcent 152
 
1327 cyprien 153
 
154
		/*************************************/
155
		/**			Champ Structures		**/
156
		/*************************************/
157
 
158
		ModelType modelTypeStructures = new ModelType();
159
		modelTypeStructures.setRoot("structures");
160
		modelTypeStructures.setTotalName("nbElements");
161
		modelTypeStructures.addField("cs_nom");
162
		modelTypeStructures.addField("cs_id_structure");
163
 
164
		String displayNameStructures = "cs_nom";
165
		ProxyStructures<ModelData> proxyStructures = new ProxyStructures<ModelData>();
166
 
167
		structuresCombo = new ChampComboBoxRechercheTempsReelPaginable(proxyStructures, modelTypeStructures, displayNameStructures);
1359 cyprien 168
		structuresCombo.setWidth(250, 650);
1327 cyprien 169
		structuresCombo.getCombo().setTabIndex(tabIndex++);
170
		structuresCombo.getCombo().setFieldLabel(i18nC.lienStructureCollection());
1342 cyprien 171
		structuresCombo.getCombo().setForceSelection(true);
1327 cyprien 172
 
173
		structuresCombo.getCombo().setValidator(new Validator() {
687 jp_milcent 174
			public String validate(Field<?> field, String value) {
175
				String retour = null;
176
				if (field.getRawValue().equals("")) {
177
					field.setValue(null);
1327 cyprien 178
				} else if (structuresCombo.getStore().findModel("cs_nom", field.getRawValue()) == null) {
687 jp_milcent 179
					String contenuBrut = field.getRawValue();
180
					field.setValue(null);
181
					field.setRawValue(contenuBrut);
182
					retour = "Veuillez sélectionner une valeur ou laisser le champ vide";
183
				}
184
				return retour;
185
			}
186
		});
1327 cyprien 187
 
188
		liaisonFieldSet.add(structuresCombo, new FormData(600, 0));
687 jp_milcent 189
 
1327 cyprien 190
 
191
		/*************************************/
192
		/**			Champ Collections		**/
193
		/*************************************/
194
 
195
		ModelType modelTypeCollections = new ModelType();
196
		modelTypeCollections.setRoot("collections");
197
		modelTypeCollections.setTotalName("nbElements");
198
		modelTypeCollections.addField("cc_nom");
199
		modelTypeCollections.addField("cc_id_collection");
200
 
201
		String displayNameCollections = "cc_nom";
202
		ProxyCollections<ModelData> proxyCollections = new ProxyCollections<ModelData>();
203
 
204
		collectionsCombo = new ChampComboBoxRechercheTempsReelPaginable(proxyCollections, modelTypeCollections, displayNameCollections);
1359 cyprien 205
		collectionsCombo.setWidth(250, 650);
1327 cyprien 206
		collectionsCombo.getCombo().setTabIndex(tabIndex++);
207
		collectionsCombo.getCombo().setFieldLabel(i18nC.lienMereCollection());
208
		collectionsCombo.getCombo().setForceSelection(true);
209
 
210
		collectionsCombo.getCombo().setValidator(new Validator() {
687 jp_milcent 211
			public String validate(Field<?> field, String value) {
212
				String retour = null;
213
				if (field.getRawValue().equals("")) {
214
					field.setValue(null);
1327 cyprien 215
				} else if (collectionsCombo.getStore().findModel("cc_nom", field.getRawValue()) == null) {
687 jp_milcent 216
					String contenuBrut = field.getRawValue();
217
					field.setValue(null);
218
					field.setRawValue(contenuBrut);
219
					retour = "Veuillez sélectionner une valeur ou laisser le champ vide";
220
				}
221
				return retour;
222
			}
223
		});
1327 cyprien 224
 
225
		liaisonFieldSet.add(collectionsCombo, new FormData(600, 0));
687 jp_milcent 226
 
227
		this.add(liaisonFieldSet);
228
	}
229
 
230
	private void creerFieldsetAdministratif() {
231
		// Fieldset ADMINISTRATIF
232
		FieldSet administratifFieldSet = new FieldSet();
233
		administratifFieldSet.setHeading(i18nC.collectionGeneralTitre());
234
		administratifFieldSet.setCollapsible(true);
858 jpm 235
		administratifFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
687 jp_milcent 236
 
859 jpm 237
		typeDepotCombo = new ChampComboBoxListeValeurs(i18nC.typeDepot(), "typeDepot", tabIndex++);
238
		administratifFieldSet.add(typeDepotCombo);
862 jpm 239
 
865 jpm 240
		coteChp = new TextField<String>();
241
		coteChp.setTabIndex(tabIndex++);
242
		coteChp.setFieldLabel(i18nC.cote());
243
		administratifFieldSet.add(coteChp, new FormData(450, 0));
862 jpm 244
 
245
		idAlternatifsChp = new ChampMultiValeurs(i18nC.idAlternatifCollection());
246
		administratifFieldSet.add(idAlternatifsChp);
247
 
248
		nomsAlternatifsChp = new ChampMultiValeurs(i18nC.intituleAlternatifCollection());
687 jp_milcent 249
		administratifFieldSet.add(nomsAlternatifsChp);
250
 
862 jpm 251
		codesAlternatifsChp = new ChampMultiValeurs(i18nC.codeAlternatifCollection());
687 jp_milcent 252
		administratifFieldSet.add(codesAlternatifsChp);
253
 
254
		this.add(administratifFieldSet);
255
	}
256
 
257
	private void creerFieldsetDescription() {
258
		// Fieldset DESCRIPTION
862 jpm 259
		FieldSet descriptionFieldSet = new FieldSet();
687 jp_milcent 260
		descriptionFieldSet.setHeading(i18nC.collectionDescriptionTitre());
261
		descriptionFieldSet.setCollapsible(true);
858 jpm 262
		descriptionFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
687 jp_milcent 263
 
862 jpm 264
		descriptionChp = new TextArea();
687 jp_milcent 265
		descriptionChp.setFieldLabel(i18nC.description());
266
		descriptionFieldSet.add(descriptionChp, new FormData(550, 0));
267
 
862 jpm 268
		descriptionSpecialisteChp = new TextArea();
687 jp_milcent 269
		descriptionSpecialisteChp.setFieldLabel(i18nC.descriptionSpecialiste());
270
		descriptionFieldSet.add(descriptionSpecialisteChp, new FormData(550, 0));
271
 
862 jpm 272
		historiqueChp = new TextArea();
687 jp_milcent 273
		historiqueChp.setFieldLabel(i18nC.historique());
274
		descriptionFieldSet.add(historiqueChp, new FormData(550, 0));
275
 
862 jpm 276
		urlsChp = new ChampMultiValeurs(i18nC.urlsCollection());
687 jp_milcent 277
		descriptionFieldSet.add(urlsChp);
278
 
279
		this.add(descriptionFieldSet);
280
	}
281
 
858 jpm 282
	private void creerFieldsetCouverture() {
283
		FieldSet couvertureFieldSet = new FieldSet();
284
		couvertureFieldSet.setHeading("Couvertures");
285
		couvertureFieldSet.setCollapsible(true);
286
		couvertureFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
287
 
1018 jpm 288
		periodeConstitutionChp = new ChampCaseACocher(i18nC.periodeConstitution(), "siecleNaturaliste", false);
289
		couvertureFieldSet.add(periodeConstitutionChp);
290
 
862 jpm 291
		groupementPrincipeCombo = new ChampComboBoxListeValeurs(i18nC.groupementPrincipeCollection(), "groupementPrincipe", tabIndex++);
292
		groupementPrincipeCombo.setToolTip(i18nC.groupementPrincipeCollectionInfo());
293
		couvertureFieldSet.add(groupementPrincipeCombo);
858 jpm 294
 
862 jpm 295
		butRealisationCombo = new ChampComboBoxListeValeurs(i18nC.butCollection(), "realisationBut", tabIndex++);
296
		couvertureFieldSet.add(butRealisationCombo);
297
 
298
		lieuCouvertureChp = new ChampMultiValeurs(i18nC.lieuCouvertureCollection());
299
		couvertureFieldSet.add(lieuCouvertureChp);
300
 
858 jpm 301
		this.add(couvertureFieldSet);
302
	}
303
 
859 jpm 304
	private void creerFieldsetType() {
305
		FieldSet typeFieldSet = new FieldSet();
306
		typeFieldSet.setHeading("Spécimens «types»");
307
		typeFieldSet.setCollapsible(true);
308
		typeFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
309
 
310
		specimenTypeCombo = new ChampComboBoxListeValeurs(i18nC.specimenTypeCollection(), "onpi", tabIndex++);
311
		typeFieldSet.add(specimenTypeCombo);
312
 
313
		ConteneurMultiChamps nbreTypeConteneur = new ConteneurMultiChamps(i18nC.nbreSpecimenTypeCollection());
314
 
315
		nbreTypeChp = new NumberField();
316
		nbreTypeChp.setFormat(NumberFormat.getFormat("#"));
317
		nbreTypeConteneur.ajouterChamp(nbreTypeChp, new HBoxLayoutData(new Margins(0, 20, 0, 0)));
318
 
319
		precisionTypeNbreCombo = new ChampComboBoxListeValeurs(null, "ea");
320
		precisionTypeNbreCombo.setTrie("id_valeur");
321
		precisionTypeNbreCombo.setEmptyText(i18nC.precisionNbreSpecimenTypeCollectionChpVide());
322
		nbreTypeConteneur.ajouterChamp(precisionTypeNbreCombo);
323
 
324
		typeFieldSet.add(nbreTypeConteneur);
325
 
326
		classementSpecimenTypeCombo = new ChampComboBoxListeValeurs(i18nC.classementSpecimenTypeCollection(), "typeClassement", tabIndex++);
327
		typeFieldSet.add(classementSpecimenTypeCombo);
328
 
329
		Text infoType = new Text(i18nC.specimenTypeCollectionInfo());
330
		typeFieldSet.add(infoType);
331
 
332
		this.add(typeFieldSet);
333
	}
334
 
867 jpm 335
	public void peupler() {
875 jpm 336
		initialiserCollection();
867 jpm 337
		if (collection != null) {
338
			idCollectionChp.setValue(collection.getId());
875 jpm 339
			setValeurComboProjets();
340
			setValeurComboStructures();
341
			setValeurComboCollections();
867 jpm 342
 
343
			typeDepotCombo.peupler(collection.getTypeDepot());
344
			coteChp.setValue(collection.getCote());
345
			idAlternatifsChp.peupler(collection.getIdAlternatif());
346
			nomsAlternatifsChp.peupler(collection.getNomAlternatif());
347
			codesAlternatifsChp.peupler(collection.getCode());
348
 
349
			descriptionChp.setValue(collection.getDescription());
350
			descriptionSpecialisteChp.setValue(collection.getDescriptionSpecialiste());
351
			historiqueChp.setValue(collection.getHistorique());
352
			urlsChp.peupler(collection.getUrls());
353
 
1218 cyprien 354
			periodeConstitutionChp.peupler(collection.getPeriodeConstitution());
867 jpm 355
			groupementPrincipeCombo.peupler(collection.getGroupementPrincipe());
356
			butRealisationCombo.peupler(collection.getGroupementBut());
357
			lieuCouvertureChp.peupler(collection.getCouvertureLieu());
358
 
359
			specimenTypeCombo.peupler(collection.getSpecimenType());
875 jpm 360
			nbreTypeChp.setValue((collection.getSpecimenTypeNbre().equals("") ? 0 : Integer.parseInt(collection.getSpecimenTypeNbre())));
867 jpm 361
			precisionTypeNbreCombo.peupler(collection.getSpecimenTypeNbrePrecision());
362
			classementSpecimenTypeCombo.peupler(collection.getSpecimenTypeClassement());
363
		}
364
	}
365
 
875 jpm 366
	public ArrayList<String> verifier() {
367
		ArrayList<String> messages = new ArrayList<String>();
1327 cyprien 368
		if (projetsCombo.getCombo().getValue() == null || !projetsCombo.getCombo().isValid()) {
1077 jpm 369
			messages.add(i18nM.selectionObligatoire(i18nC.articleUn()+" "+i18nC.projetSingulier(), i18nC.articleLa()+" "+i18nC.collectionSingulier()));
875 jpm 370
		}
371
		return messages;
372
	}
373
 
867 jpm 374
	public void collecter() {
875 jpm 375
		initialiserCollection();
867 jpm 376
		if (etreAccede()) {
377
			collectionCollectee.setId(idCollectionChp.getValue());
968 jpm 378
			collectionCollectee.setIdProjet(getValeurComboProjets());
875 jpm 379
			collectionCollectee.setIdStructure(getValeurComboStructures());
380
			collectionCollectee.setCollectionMereId(getValeurComboCollections());
867 jpm 381
 
382
			collectionCollectee.setTypeDepot(typeDepotCombo.getValeur());
383
			collectionCollectee.setCote(coteChp.getValue());
384
			collectionCollectee.setIdAlternatif(idAlternatifsChp.getValeurs());
385
			collectionCollectee.setNomAlternatif(nomsAlternatifsChp.getValeurs());
386
			collectionCollectee.setCode(codesAlternatifsChp.getValeurs());
387
 
388
			collectionCollectee.setDescription(descriptionChp.getValue());
389
			collectionCollectee.setDescriptionSpecialiste(descriptionSpecialisteChp.getValue());
390
			collectionCollectee.setHistorique(historiqueChp.getValue());
391
			collectionCollectee.setUrls(urlsChp.getValeurs());
392
 
1018 jpm 393
			collectionCollectee.setPeriodeConstitution(periodeConstitutionChp.getValeur());
867 jpm 394
			collectionCollectee.setGroupementPrincipe(groupementPrincipeCombo.getValeur());
395
			collectionCollectee.setGroupementBut(butRealisationCombo.getValeur());
396
			collectionCollectee.setCouvertureLieu(lieuCouvertureChp.getValeurs());
397
 
398
			collectionCollectee.setSpecimenType(specimenTypeCombo.getValeur());
968 jpm 399
			if (nbreTypeChp.getValue() != null) {
400
				collectionCollectee.setSpecimenTypeNbre(nbreTypeChp.getValue().toString());
401
			}
867 jpm 402
			collectionCollectee.setSpecimenTypeNbrePrecision(precisionTypeNbreCombo.getValeur());
403
			collectionCollectee.setSpecimenTypeClassement(classementSpecimenTypeCombo.getValeur());
404
		}
405
	}
406
 
875 jpm 407
	private String getValeurComboProjets() {
408
		String valeur = "";
1327 cyprien 409
		if (projetsCombo.getCombo().getValue() != null) {
410
			Projet projet = new Projet(projetsCombo.getValeur());
411
			valeur = projet.getId();
875 jpm 412
		}
413
		return valeur;
414
	}
415
	private void setValeurComboProjets() {
867 jpm 416
		if (projetsCombo.getStore() != null && collection != null) {
1327 cyprien 417
			projetsCombo.getCombo().setValue(projetsCombo.getStore().findModel("cpr_id_projet", collection.getIdProjet()));
867 jpm 418
		}
419
	}
420
 
875 jpm 421
	private String getValeurComboStructures() {
422
		String valeur = "";
1327 cyprien 423
		if (structuresCombo.getCombo().getValue() != null) {
424
			Structure structure = new Structure(structuresCombo.getValeur());
425
			valeur = structure.getId();
875 jpm 426
		}
427
		return valeur;
428
	}
429
	private void setValeurComboStructures() {
867 jpm 430
		if (structuresCombo.getStore() != null && collection != null) {
1327 cyprien 431
			structuresCombo.getCombo().setValue(structuresCombo.getStore().findModel("cs_id_structure", collection.getIdStructure()));
867 jpm 432
		}
433
	}
434
 
875 jpm 435
	private String getValeurComboCollections() {
436
		String valeur = "";
1327 cyprien 437
		if (collectionsCombo.getCombo().getValue() != null) {
438
			Collection collection = new Collection(collectionsCombo.getValeur());
439
			valeur = collection.getId();
875 jpm 440
		}
441
		return valeur;
442
	}
443
	private void setValeurComboCollections() {
1327 cyprien 444
		if (collectionsCombo.getCombo().getStore() != null && collection != null) {
445
			collectionsCombo.getCombo().setValue(collectionsCombo.getStore().findModel("id_collection", collection.getCollectionMereId()));
867 jpm 446
		}
447
	}
448
 
687 jp_milcent 449
	public void rafraichir(Object nouvellesDonnees) {
1327 cyprien 450
		if (nouvellesDonnees instanceof ValeurListe) {
858 jpm 451
			ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
452
			rafraichirValeurListe(listeValeurs);
687 jp_milcent 453
		} else {
951 jpm 454
			Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
687 jp_milcent 455
		}
456
	}
457
 
458
	private void rafraichirValeurListe(ValeurListe listeValeurs) {
858 jpm 459
		if (listeValeurs.getId().equals(config.getListeId("typeDepot"))) {
831 jpm 460
			Formulaire.rafraichirComboBox(listeValeurs, typeDepotCombo);
687 jp_milcent 461
		} else {
951 jpm 462
			Debug.log("Gestion de la liste "+listeValeurs.getId()+" non implémenté!");
687 jp_milcent 463
		}
464
	}
465
 
703 jp_milcent 466
 
687 jp_milcent 467
 
468
}