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