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