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;
|
1329 |
cyprien |
9 |
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
|
687 |
jp_milcent |
10 |
import org.tela_botanica.client.composants.ChampMultiValeurs;
|
859 |
jpm |
11 |
import org.tela_botanica.client.composants.ConteneurMultiChamps;
|
1329 |
cyprien |
12 |
import org.tela_botanica.client.composants.pagination.ProxyCollections;
|
|
|
13 |
import org.tela_botanica.client.composants.pagination.ProxyStructures;
|
687 |
jp_milcent |
14 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
|
|
15 |
import org.tela_botanica.client.modeles.ValeurListe;
|
935 |
jpm |
16 |
import org.tela_botanica.client.modeles.collection.Collection;
|
|
|
17 |
import org.tela_botanica.client.modeles.structure.Structure;
|
1367 |
cyprien |
18 |
import org.tela_botanica.client.synchronisation.Sequenceur;
|
951 |
jpm |
19 |
import org.tela_botanica.client.util.Debug;
|
1428 |
cyprien |
20 |
import org.tela_botanica.client.util.UtilString;
|
934 |
jpm |
21 |
import org.tela_botanica.client.vues.Formulaire;
|
|
|
22 |
import org.tela_botanica.client.vues.FormulaireOnglet;
|
858 |
jpm |
23 |
|
1329 |
cyprien |
24 |
import com.extjs.gxt.ui.client.data.ModelData;
|
|
|
25 |
import com.extjs.gxt.ui.client.data.ModelType;
|
968 |
jpm |
26 |
import com.extjs.gxt.ui.client.event.Events;
|
859 |
jpm |
27 |
import com.extjs.gxt.ui.client.util.Margins;
|
|
|
28 |
import com.extjs.gxt.ui.client.widget.Text;
|
687 |
jp_milcent |
29 |
import com.extjs.gxt.ui.client.widget.form.Field;
|
|
|
30 |
import com.extjs.gxt.ui.client.widget.form.FieldSet;
|
|
|
31 |
import com.extjs.gxt.ui.client.widget.form.HiddenField;
|
859 |
jpm |
32 |
import com.extjs.gxt.ui.client.widget.form.NumberField;
|
687 |
jp_milcent |
33 |
import com.extjs.gxt.ui.client.widget.form.TextArea;
|
862 |
jpm |
34 |
import com.extjs.gxt.ui.client.widget.form.TextField;
|
687 |
jp_milcent |
35 |
import com.extjs.gxt.ui.client.widget.form.Validator;
|
|
|
36 |
import com.extjs.gxt.ui.client.widget.layout.FormData;
|
859 |
jpm |
37 |
import com.extjs.gxt.ui.client.widget.layout.HBoxLayoutData;
|
|
|
38 |
import com.google.gwt.i18n.client.NumberFormat;
|
687 |
jp_milcent |
39 |
|
|
|
40 |
public class CollectionFormGeneral extends FormulaireOnglet implements Rafraichissable {
|
|
|
41 |
|
1083 |
jpm |
42 |
public static final String ID = "general";
|
867 |
jpm |
43 |
private Collection collection = null;
|
|
|
44 |
private Collection collectionCollectee = null;
|
|
|
45 |
|
1018 |
jpm |
46 |
private HiddenField<String> idCollectionChp = null;
|
687 |
jp_milcent |
47 |
|
1329 |
cyprien |
48 |
private ChampComboBoxRechercheTempsReelPaginable structuresCombo = null;
|
|
|
49 |
private ChampComboBoxRechercheTempsReelPaginable collectionsCombo = null;
|
858 |
jpm |
50 |
|
1018 |
jpm |
51 |
private ChampCaseACocher periodeConstitutionChp = null;
|
862 |
jpm |
52 |
private ChampMultiValeurs lieuCouvertureChp = null;
|
687 |
jp_milcent |
53 |
|
859 |
jpm |
54 |
private ChampComboBoxListeValeurs specimenTypeCombo = null;
|
|
|
55 |
private ChampComboBoxListeValeurs precisionTypeNbreCombo = null;
|
|
|
56 |
private NumberField nbreTypeChp = null;
|
1018 |
jpm |
57 |
private ChampComboBoxListeValeurs classementSpecimenTypeCombo = null;
|
858 |
jpm |
58 |
|
867 |
jpm |
59 |
private ChampComboBoxListeValeurs typeDepotCombo = null;
|
865 |
jpm |
60 |
private TextField<String> coteChp = null;
|
|
|
61 |
private ChampMultiValeurs nomsAlternatifsChp = null;
|
|
|
62 |
private ChampMultiValeurs codesAlternatifsChp = null;
|
862 |
jpm |
63 |
|
865 |
jpm |
64 |
private TextArea descriptionChp = null;
|
|
|
65 |
private TextArea historiqueChp = null;
|
|
|
66 |
private ChampMultiValeurs urlsChp = null;
|
862 |
jpm |
67 |
|
1367 |
cyprien |
68 |
private Sequenceur sequenceur = new Sequenceur();
|
|
|
69 |
|
687 |
jp_milcent |
70 |
public CollectionFormGeneral(Formulaire formulaireCourrant) {
|
|
|
71 |
initialiserOnglet(formulaireCourrant);
|
1083 |
jpm |
72 |
setId(ID);
|
687 |
jp_milcent |
73 |
setText(Mediateur.i18nC.collectionGeneral());
|
|
|
74 |
|
|
|
75 |
creerChampsCache();
|
|
|
76 |
creerFieldsetLiaison();
|
|
|
77 |
creerFieldsetAdministratif();
|
|
|
78 |
creerFieldsetDescription();
|
858 |
jpm |
79 |
creerFieldsetCouverture();
|
859 |
jpm |
80 |
creerFieldsetType();
|
687 |
jp_milcent |
81 |
}
|
|
|
82 |
|
875 |
jpm |
83 |
private void initialiserCollection() {
|
|
|
84 |
collection = ((CollectionForm) formulaire).collection;
|
|
|
85 |
collectionCollectee = ((CollectionForm) formulaire).collectionCollectee;
|
|
|
86 |
}
|
|
|
87 |
|
687 |
jp_milcent |
88 |
private void creerChampsCache() {
|
|
|
89 |
// Champs cachés
|
|
|
90 |
idCollectionChp = new HiddenField<String>();
|
|
|
91 |
this.add(idCollectionChp);
|
|
|
92 |
}
|
|
|
93 |
|
|
|
94 |
private void creerFieldsetLiaison() {
|
1428 |
cyprien |
95 |
|
687 |
jp_milcent |
96 |
FieldSet liaisonFieldSet = new FieldSet();
|
1680 |
raphael |
97 |
liaisonFieldSet.setHeadingHtml(i18nC.liaisonTitreCollection());
|
687 |
jp_milcent |
98 |
liaisonFieldSet.setCollapsible(true);
|
858 |
jpm |
99 |
liaisonFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
687 |
jp_milcent |
100 |
|
1329 |
cyprien |
101 |
|
1526 |
jpm |
102 |
//+-----------------------------------------------------------------------------------------------------------+
|
|
|
103 |
// Champ Structures
|
1329 |
cyprien |
104 |
|
|
|
105 |
ModelType modelTypeStructures = new ModelType();
|
|
|
106 |
modelTypeStructures.setRoot("structures");
|
|
|
107 |
modelTypeStructures.setTotalName("nbElements");
|
|
|
108 |
modelTypeStructures.addField("cs_nom");
|
|
|
109 |
modelTypeStructures.addField("cs_id_structure");
|
|
|
110 |
|
|
|
111 |
String displayNameStructures = "cs_nom";
|
1468 |
jpm |
112 |
ProxyStructures<ModelData> proxyStructures = new ProxyStructures<ModelData>(null);
|
1329 |
cyprien |
113 |
|
|
|
114 |
structuresCombo = new ChampComboBoxRechercheTempsReelPaginable(proxyStructures, modelTypeStructures, displayNameStructures);
|
|
|
115 |
structuresCombo.setWidth(250, 600);
|
|
|
116 |
structuresCombo.getCombo().setTabIndex(tabIndex++);
|
|
|
117 |
structuresCombo.getCombo().setFieldLabel(i18nC.lienStructureCollection());
|
|
|
118 |
structuresCombo.getCombo().setForceSelection(true);
|
|
|
119 |
|
|
|
120 |
structuresCombo.getCombo().setValidator(new Validator() {
|
687 |
jp_milcent |
121 |
public String validate(Field<?> field, String value) {
|
|
|
122 |
String retour = null;
|
|
|
123 |
if (field.getRawValue().equals("")) {
|
|
|
124 |
field.setValue(null);
|
1329 |
cyprien |
125 |
} else if (structuresCombo.getStore().findModel("cs_nom", field.getRawValue()) == null) {
|
687 |
jp_milcent |
126 |
String contenuBrut = field.getRawValue();
|
|
|
127 |
field.setValue(null);
|
|
|
128 |
field.setRawValue(contenuBrut);
|
|
|
129 |
retour = "Veuillez sélectionner une valeur ou laisser le champ vide";
|
|
|
130 |
}
|
|
|
131 |
return retour;
|
|
|
132 |
}
|
|
|
133 |
});
|
1329 |
cyprien |
134 |
|
|
|
135 |
liaisonFieldSet.add(structuresCombo, new FormData(600, 0));
|
687 |
jp_milcent |
136 |
|
1329 |
cyprien |
137 |
|
1526 |
jpm |
138 |
//+-----------------------------------------------------------------------------------------------------------+
|
|
|
139 |
// Champ Collections
|
1329 |
cyprien |
140 |
|
|
|
141 |
ModelType modelTypeCollections = new ModelType();
|
|
|
142 |
modelTypeCollections.setRoot("collections");
|
|
|
143 |
modelTypeCollections.setTotalName("nbElements");
|
|
|
144 |
modelTypeCollections.addField("cc_nom");
|
|
|
145 |
modelTypeCollections.addField("cc_id_collection");
|
1367 |
cyprien |
146 |
modelTypeCollections.addField("cc_ce_mere");
|
1329 |
cyprien |
147 |
|
|
|
148 |
String displayNameCollections = "cc_nom";
|
1468 |
jpm |
149 |
ProxyCollections<ModelData> proxyCollections = new ProxyCollections<ModelData>(null);
|
1329 |
cyprien |
150 |
|
|
|
151 |
collectionsCombo = new ChampComboBoxRechercheTempsReelPaginable(proxyCollections, modelTypeCollections, displayNameCollections);
|
|
|
152 |
collectionsCombo.setWidth(250, 600);
|
|
|
153 |
collectionsCombo.getCombo().setTabIndex(tabIndex++);
|
|
|
154 |
collectionsCombo.getCombo().setFieldLabel(i18nC.lienMereCollection());
|
1428 |
cyprien |
155 |
collectionsCombo.getCombo().setForceSelection(true);
|
1329 |
cyprien |
156 |
|
|
|
157 |
collectionsCombo.getCombo().setValidator(new Validator() {
|
687 |
jp_milcent |
158 |
public String validate(Field<?> field, String value) {
|
|
|
159 |
String retour = null;
|
|
|
160 |
if (field.getRawValue().equals("")) {
|
|
|
161 |
field.setValue(null);
|
1329 |
cyprien |
162 |
} else if (collectionsCombo.getStore().findModel("cc_nom", field.getRawValue()) == null) {
|
687 |
jp_milcent |
163 |
String contenuBrut = field.getRawValue();
|
|
|
164 |
field.setValue(null);
|
|
|
165 |
field.setRawValue(contenuBrut);
|
|
|
166 |
retour = "Veuillez sélectionner une valeur ou laisser le champ vide";
|
|
|
167 |
}
|
|
|
168 |
return retour;
|
|
|
169 |
}
|
|
|
170 |
});
|
1329 |
cyprien |
171 |
|
|
|
172 |
liaisonFieldSet.add(collectionsCombo, new FormData(600, 0));
|
687 |
jp_milcent |
173 |
|
|
|
174 |
this.add(liaisonFieldSet);
|
|
|
175 |
}
|
|
|
176 |
|
|
|
177 |
private void creerFieldsetAdministratif() {
|
|
|
178 |
// Fieldset ADMINISTRATIF
|
|
|
179 |
FieldSet administratifFieldSet = new FieldSet();
|
1680 |
raphael |
180 |
administratifFieldSet.setHeadingHtml(i18nC.collectionGeneralTitre());
|
687 |
jp_milcent |
181 |
administratifFieldSet.setCollapsible(true);
|
1900 |
aurelien |
182 |
administratifFieldSet.collapse();
|
858 |
jpm |
183 |
administratifFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
687 |
jp_milcent |
184 |
|
859 |
jpm |
185 |
typeDepotCombo = new ChampComboBoxListeValeurs(i18nC.typeDepot(), "typeDepot", tabIndex++);
|
|
|
186 |
administratifFieldSet.add(typeDepotCombo);
|
862 |
jpm |
187 |
|
865 |
jpm |
188 |
coteChp = new TextField<String>();
|
|
|
189 |
coteChp.setTabIndex(tabIndex++);
|
|
|
190 |
coteChp.setFieldLabel(i18nC.cote());
|
|
|
191 |
administratifFieldSet.add(coteChp, new FormData(450, 0));
|
862 |
jpm |
192 |
|
|
|
193 |
nomsAlternatifsChp = new ChampMultiValeurs(i18nC.intituleAlternatifCollection());
|
687 |
jp_milcent |
194 |
administratifFieldSet.add(nomsAlternatifsChp);
|
|
|
195 |
|
862 |
jpm |
196 |
codesAlternatifsChp = new ChampMultiValeurs(i18nC.codeAlternatifCollection());
|
687 |
jp_milcent |
197 |
administratifFieldSet.add(codesAlternatifsChp);
|
|
|
198 |
|
|
|
199 |
this.add(administratifFieldSet);
|
|
|
200 |
}
|
|
|
201 |
|
|
|
202 |
private void creerFieldsetDescription() {
|
|
|
203 |
// Fieldset DESCRIPTION
|
862 |
jpm |
204 |
FieldSet descriptionFieldSet = new FieldSet();
|
1680 |
raphael |
205 |
descriptionFieldSet.setHeadingHtml(i18nC.collectionDescriptionTitre());
|
687 |
jp_milcent |
206 |
descriptionFieldSet.setCollapsible(true);
|
858 |
jpm |
207 |
descriptionFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
687 |
jp_milcent |
208 |
|
862 |
jpm |
209 |
descriptionChp = new TextArea();
|
687 |
jp_milcent |
210 |
descriptionChp.setFieldLabel(i18nC.description());
|
|
|
211 |
descriptionFieldSet.add(descriptionChp, new FormData(550, 0));
|
|
|
212 |
|
862 |
jpm |
213 |
historiqueChp = new TextArea();
|
687 |
jp_milcent |
214 |
historiqueChp.setFieldLabel(i18nC.historique());
|
|
|
215 |
descriptionFieldSet.add(historiqueChp, new FormData(550, 0));
|
|
|
216 |
|
862 |
jpm |
217 |
urlsChp = new ChampMultiValeurs(i18nC.urlsCollection());
|
687 |
jp_milcent |
218 |
descriptionFieldSet.add(urlsChp);
|
|
|
219 |
|
|
|
220 |
this.add(descriptionFieldSet);
|
|
|
221 |
}
|
|
|
222 |
|
858 |
jpm |
223 |
private void creerFieldsetCouverture() {
|
|
|
224 |
FieldSet couvertureFieldSet = new FieldSet();
|
1680 |
raphael |
225 |
couvertureFieldSet.setHeadingHtml("Couvertures");
|
858 |
jpm |
226 |
couvertureFieldSet.setCollapsible(true);
|
1900 |
aurelien |
227 |
couvertureFieldSet.collapse();
|
858 |
jpm |
228 |
couvertureFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
|
|
229 |
|
1018 |
jpm |
230 |
periodeConstitutionChp = new ChampCaseACocher(i18nC.periodeConstitution(), "siecleNaturaliste", false);
|
|
|
231 |
couvertureFieldSet.add(periodeConstitutionChp);
|
|
|
232 |
|
862 |
jpm |
233 |
lieuCouvertureChp = new ChampMultiValeurs(i18nC.lieuCouvertureCollection());
|
|
|
234 |
couvertureFieldSet.add(lieuCouvertureChp);
|
|
|
235 |
|
858 |
jpm |
236 |
this.add(couvertureFieldSet);
|
|
|
237 |
}
|
|
|
238 |
|
859 |
jpm |
239 |
private void creerFieldsetType() {
|
|
|
240 |
FieldSet typeFieldSet = new FieldSet();
|
1680 |
raphael |
241 |
typeFieldSet.setHeadingHtml("Spécimens «types»");
|
859 |
jpm |
242 |
typeFieldSet.setCollapsible(true);
|
1900 |
aurelien |
243 |
typeFieldSet.collapse();
|
859 |
jpm |
244 |
typeFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
|
|
245 |
|
|
|
246 |
specimenTypeCombo = new ChampComboBoxListeValeurs(i18nC.specimenTypeCollection(), "onpi", tabIndex++);
|
|
|
247 |
typeFieldSet.add(specimenTypeCombo);
|
|
|
248 |
|
|
|
249 |
ConteneurMultiChamps nbreTypeConteneur = new ConteneurMultiChamps(i18nC.nbreSpecimenTypeCollection());
|
|
|
250 |
|
|
|
251 |
nbreTypeChp = new NumberField();
|
|
|
252 |
nbreTypeChp.setFormat(NumberFormat.getFormat("#"));
|
|
|
253 |
nbreTypeConteneur.ajouterChamp(nbreTypeChp, new HBoxLayoutData(new Margins(0, 20, 0, 0)));
|
|
|
254 |
|
|
|
255 |
precisionTypeNbreCombo = new ChampComboBoxListeValeurs(null, "ea");
|
|
|
256 |
precisionTypeNbreCombo.setTrie("id_valeur");
|
|
|
257 |
precisionTypeNbreCombo.setEmptyText(i18nC.precisionNbreSpecimenTypeCollectionChpVide());
|
|
|
258 |
nbreTypeConteneur.ajouterChamp(precisionTypeNbreCombo);
|
|
|
259 |
|
|
|
260 |
typeFieldSet.add(nbreTypeConteneur);
|
|
|
261 |
|
|
|
262 |
classementSpecimenTypeCombo = new ChampComboBoxListeValeurs(i18nC.classementSpecimenTypeCollection(), "typeClassement", tabIndex++);
|
|
|
263 |
typeFieldSet.add(classementSpecimenTypeCombo);
|
|
|
264 |
|
|
|
265 |
Text infoType = new Text(i18nC.specimenTypeCollectionInfo());
|
|
|
266 |
typeFieldSet.add(infoType);
|
|
|
267 |
|
|
|
268 |
this.add(typeFieldSet);
|
|
|
269 |
}
|
|
|
270 |
|
867 |
jpm |
271 |
public void peupler() {
|
875 |
jpm |
272 |
initialiserCollection();
|
867 |
jpm |
273 |
if (collection != null) {
|
|
|
274 |
idCollectionChp.setValue(collection.getId());
|
875 |
jpm |
275 |
setValeurComboStructures();
|
|
|
276 |
setValeurComboCollections();
|
867 |
jpm |
277 |
|
|
|
278 |
typeDepotCombo.peupler(collection.getTypeDepot());
|
|
|
279 |
coteChp.setValue(collection.getCote());
|
|
|
280 |
nomsAlternatifsChp.peupler(collection.getNomAlternatif());
|
|
|
281 |
codesAlternatifsChp.peupler(collection.getCode());
|
|
|
282 |
|
|
|
283 |
descriptionChp.setValue(collection.getDescription());
|
|
|
284 |
historiqueChp.setValue(collection.getHistorique());
|
|
|
285 |
urlsChp.peupler(collection.getUrls());
|
|
|
286 |
|
1239 |
cyprien |
287 |
periodeConstitutionChp.peupler(collection.getPeriodeConstitution());
|
867 |
jpm |
288 |
lieuCouvertureChp.peupler(collection.getCouvertureLieu());
|
|
|
289 |
|
|
|
290 |
specimenTypeCombo.peupler(collection.getSpecimenType());
|
875 |
jpm |
291 |
nbreTypeChp.setValue((collection.getSpecimenTypeNbre().equals("") ? 0 : Integer.parseInt(collection.getSpecimenTypeNbre())));
|
867 |
jpm |
292 |
precisionTypeNbreCombo.peupler(collection.getSpecimenTypeNbrePrecision());
|
|
|
293 |
classementSpecimenTypeCombo.peupler(collection.getSpecimenTypeClassement());
|
|
|
294 |
}
|
|
|
295 |
}
|
|
|
296 |
|
875 |
jpm |
297 |
public ArrayList<String> verifier() {
|
|
|
298 |
ArrayList<String> messages = new ArrayList<String>();
|
|
|
299 |
return messages;
|
|
|
300 |
}
|
|
|
301 |
|
867 |
jpm |
302 |
public void collecter() {
|
875 |
jpm |
303 |
initialiserCollection();
|
1613 |
aurelien |
304 |
// l'onglet collection est obligatoirement rempli lors d'un ajout
|
|
|
305 |
if (this.mode == Formulaire.MODE_AJOUTER || etreAccede()) {
|
867 |
jpm |
306 |
collectionCollectee.setId(idCollectionChp.getValue());
|
875 |
jpm |
307 |
collectionCollectee.setIdStructure(getValeurComboStructures());
|
|
|
308 |
collectionCollectee.setCollectionMereId(getValeurComboCollections());
|
867 |
jpm |
309 |
|
|
|
310 |
collectionCollectee.setTypeDepot(typeDepotCombo.getValeur());
|
|
|
311 |
collectionCollectee.setCote(coteChp.getValue());
|
|
|
312 |
collectionCollectee.setNomAlternatif(nomsAlternatifsChp.getValeurs());
|
|
|
313 |
collectionCollectee.setCode(codesAlternatifsChp.getValeurs());
|
|
|
314 |
|
|
|
315 |
collectionCollectee.setDescription(descriptionChp.getValue());
|
|
|
316 |
collectionCollectee.setHistorique(historiqueChp.getValue());
|
|
|
317 |
collectionCollectee.setUrls(urlsChp.getValeurs());
|
|
|
318 |
|
1018 |
jpm |
319 |
collectionCollectee.setPeriodeConstitution(periodeConstitutionChp.getValeur());
|
867 |
jpm |
320 |
collectionCollectee.setCouvertureLieu(lieuCouvertureChp.getValeurs());
|
|
|
321 |
|
|
|
322 |
collectionCollectee.setSpecimenType(specimenTypeCombo.getValeur());
|
968 |
jpm |
323 |
if (nbreTypeChp.getValue() != null) {
|
|
|
324 |
collectionCollectee.setSpecimenTypeNbre(nbreTypeChp.getValue().toString());
|
|
|
325 |
}
|
867 |
jpm |
326 |
collectionCollectee.setSpecimenTypeNbrePrecision(precisionTypeNbreCombo.getValeur());
|
|
|
327 |
collectionCollectee.setSpecimenTypeClassement(classementSpecimenTypeCombo.getValeur());
|
|
|
328 |
}
|
|
|
329 |
}
|
|
|
330 |
|
875 |
jpm |
331 |
private String getValeurComboStructures() {
|
|
|
332 |
String valeur = "";
|
1329 |
cyprien |
333 |
if (structuresCombo.getCombo().getValue() != null) {
|
|
|
334 |
Structure structure = new Structure(structuresCombo.getValeur());
|
|
|
335 |
valeur = structure.getId();
|
875 |
jpm |
336 |
}
|
|
|
337 |
return valeur;
|
|
|
338 |
}
|
|
|
339 |
private void setValeurComboStructures() {
|
1513 |
jpm |
340 |
if (structuresCombo.getCombo().getStore() != null
|
1428 |
cyprien |
341 |
&& collection != null
|
|
|
342 |
&& collection.getStructureNom() != null
|
|
|
343 |
&& !UtilString.isEmpty(collection.getStructureNom())) {
|
|
|
344 |
structuresCombo.chargerValeurInitiale(collection.getStructureNom(), "cs_nom");
|
|
|
345 |
} else {
|
|
|
346 |
structuresCombo.getCombo().setValue(null);
|
867 |
jpm |
347 |
}
|
|
|
348 |
}
|
|
|
349 |
|
875 |
jpm |
350 |
private String getValeurComboCollections() {
|
|
|
351 |
String valeur = "";
|
1329 |
cyprien |
352 |
if (collectionsCombo.getCombo().getValue() != null) {
|
|
|
353 |
Collection collection = new Collection(collectionsCombo.getValeur());
|
|
|
354 |
valeur = collection.getId();
|
875 |
jpm |
355 |
}
|
|
|
356 |
return valeur;
|
|
|
357 |
}
|
1428 |
cyprien |
358 |
private void setValeurComboCollections() {
|
|
|
359 |
if (collectionsCombo.getCombo().getStore() != null
|
|
|
360 |
&& collection != null
|
|
|
361 |
&& collection.getCollectionMereNom() != null
|
|
|
362 |
&& !UtilString.isEmpty(collection.getCollectionMereNom())) {
|
|
|
363 |
collectionsCombo.chargerValeurInitiale(collection.getCollectionMereNom(), "cc_nom");
|
867 |
jpm |
364 |
}
|
|
|
365 |
}
|
|
|
366 |
|
687 |
jp_milcent |
367 |
public void rafraichir(Object nouvellesDonnees) {
|
1329 |
cyprien |
368 |
if (nouvellesDonnees instanceof ValeurListe) {
|
858 |
jpm |
369 |
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
|
|
|
370 |
rafraichirValeurListe(listeValeurs);
|
687 |
jp_milcent |
371 |
} else {
|
951 |
jpm |
372 |
Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
|
687 |
jp_milcent |
373 |
}
|
|
|
374 |
}
|
|
|
375 |
|
|
|
376 |
private void rafraichirValeurListe(ValeurListe listeValeurs) {
|
858 |
jpm |
377 |
if (listeValeurs.getId().equals(config.getListeId("typeDepot"))) {
|
831 |
jpm |
378 |
Formulaire.rafraichirComboBox(listeValeurs, typeDepotCombo);
|
687 |
jp_milcent |
379 |
} else {
|
951 |
jpm |
380 |
Debug.log("Gestion de la liste "+listeValeurs.getId()+" non implémenté!");
|
687 |
jp_milcent |
381 |
}
|
|
|
382 |
}
|
|
|
383 |
|
703 |
jp_milcent |
384 |
|
687 |
jp_milcent |
385 |
|
|
|
386 |
}
|