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