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