1 |
package org.tela_botanica.client.vues.collection;
|
1 |
package org.tela_botanica.client.vues.collection;
|
- |
|
2 |
|
- |
|
3 |
import java.util.HashMap;
|
- |
|
4 |
import java.util.Iterator;
|
2 |
|
5 |
|
3 |
import org.tela_botanica.client.Mediateur;
|
6 |
import org.tela_botanica.client.Mediateur;
|
4 |
import org.tela_botanica.client.composants.ChampCaseACocher;
|
7 |
import org.tela_botanica.client.composants.ChampCaseACocher;
|
5 |
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
|
8 |
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
|
6 |
import org.tela_botanica.client.composants.ChampSliderPourcentage;
|
9 |
import org.tela_botanica.client.composants.ChampSliderPourcentage;
|
7 |
import org.tela_botanica.client.composants.ConteneurMultiChamps;
|
10 |
import org.tela_botanica.client.composants.ConteneurMultiChamps;
|
8 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
11 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
9 |
import org.tela_botanica.client.modeles.ValeurListe;
|
12 |
import org.tela_botanica.client.modeles.aDonnee;
|
- |
|
13 |
import org.tela_botanica.client.modeles.collection.Collection;
|
- |
|
14 |
import org.tela_botanica.client.modeles.collection.CollectionBotanique;
|
- |
|
15 |
import org.tela_botanica.client.util.Debug;
|
- |
|
16 |
import org.tela_botanica.client.util.Pattern;
|
- |
|
17 |
import org.tela_botanica.client.util.UtilDate;
|
- |
|
18 |
import org.tela_botanica.client.util.UtilString;
|
10 |
import org.tela_botanica.client.vues.Formulaire;
|
19 |
import org.tela_botanica.client.vues.Formulaire;
|
11 |
import org.tela_botanica.client.vues.FormulaireOnglet;
|
20 |
import org.tela_botanica.client.vues.FormulaireOnglet;
|
12 |
|
21 |
|
13 |
import com.extjs.gxt.ui.client.util.Margins;
|
22 |
import com.extjs.gxt.ui.client.util.Margins;
|
14 |
import com.extjs.gxt.ui.client.widget.Text;
|
23 |
import com.extjs.gxt.ui.client.widget.Text;
|
15 |
import com.extjs.gxt.ui.client.widget.form.DateField;
|
24 |
import com.extjs.gxt.ui.client.widget.form.DateField;
|
16 |
import com.extjs.gxt.ui.client.widget.form.FieldSet;
|
25 |
import com.extjs.gxt.ui.client.widget.form.FieldSet;
|
17 |
import com.extjs.gxt.ui.client.widget.form.TextArea;
|
26 |
import com.extjs.gxt.ui.client.widget.form.TextArea;
|
18 |
import com.extjs.gxt.ui.client.widget.layout.FormData;
|
27 |
import com.extjs.gxt.ui.client.widget.layout.FormData;
|
19 |
import com.extjs.gxt.ui.client.widget.layout.HBoxLayoutData;
|
28 |
import com.extjs.gxt.ui.client.widget.layout.HBoxLayoutData;
|
20 |
import com.google.gwt.core.client.GWT;
|
- |
|
21 |
|
29 |
|
22 |
public class CollectionFormContenu extends FormulaireOnglet implements Rafraichissable {
|
30 |
public class CollectionFormContenu extends FormulaireOnglet implements Rafraichissable {
|
- |
|
31 |
|
- |
|
32 |
private Collection collection = null;
|
- |
|
33 |
private CollectionBotanique collectionBotanique = null;
|
- |
|
34 |
private Collection collectionCollectee = null;
|
- |
|
35 |
private CollectionBotanique collectionBotaniqueCollectee = null;
|
23 |
|
36 |
|
24 |
private ChampCaseACocher natureChp = null;
|
37 |
private ChampCaseACocher natureChp = null;
|
25 |
private TextArea specialiteChp = null;
|
38 |
private TextArea specialiteChp = null;
|
26 |
private ChampCaseACocher periodeConstitutionChp = null;
|
39 |
private ChampCaseACocher periodeConstitutionChp = null;
|
27 |
private ChampComboBoxListeValeurs dateDebutCombo = null;
|
40 |
private ChampComboBoxListeValeurs dateDebutCombo = null;
|
28 |
private ChampComboBoxListeValeurs dateFinCombo = null;
|
41 |
private ChampComboBoxListeValeurs dateFinCombo = null;
|
29 |
private DateField dateDebutChp = null;
|
42 |
private DateField dateDebutChp = null;
|
30 |
private DateField dateFinChp = null;
|
43 |
private DateField dateFinChp = null;
|
31 |
private TextArea annotationClassementChp = null;
|
44 |
private TextArea annotationClassementChp = null;
|
32 |
private ChampComboBoxListeValeurs etatClassementCombo = null;
|
45 |
private ChampComboBoxListeValeurs etatClassementCombo = null;
|
33 |
private ChampComboBoxListeValeurs precisionDateCombo = null;
|
46 |
private ChampComboBoxListeValeurs precisionDateCombo = null;
|
34 |
private ChampComboBoxListeValeurs precisionLocaliteCombo = null;
|
47 |
private ChampComboBoxListeValeurs precisionLocaliteCombo = null;
|
35 |
private TextArea etiquetteAnnotationChp = null;
|
48 |
private TextArea etiquetteAnnotationChp = null;
|
36 |
private ChampComboBoxListeValeurs integreCollectionCombo = null;
|
49 |
private ChampComboBoxListeValeurs integreCollectionCombo = null;
|
37 |
private ChampComboBoxListeValeurs infoIntegreCollectionCombo = null;
|
50 |
private ChampComboBoxListeValeurs infoIntegreCollectionCombo = null;
|
38 |
private ChampSliderPourcentage auteurTitrePourcentChp;
|
51 |
private ChampSliderPourcentage auteurTitrePourcentChp;
|
39 |
private ChampSliderPourcentage famillePourcentChp;
|
52 |
private ChampSliderPourcentage famillePourcentChp;
|
40 |
private ChampSliderPourcentage genrePourcentChp;
|
53 |
private ChampSliderPourcentage genrePourcentChp;
|
41 |
private ChampSliderPourcentage spPourcentChp;
|
54 |
private ChampSliderPourcentage spPourcentChp;
|
42 |
private ChampSliderPourcentage auteurSpPourcentChp;
|
55 |
private ChampSliderPourcentage auteurSpPourcentChp;
|
43 |
private ChampSliderPourcentage localitePourcentChp;
|
56 |
private ChampSliderPourcentage localitePourcentChp;
|
44 |
private ChampSliderPourcentage datePourcentChp;
|
57 |
private ChampSliderPourcentage datePourcentChp;
|
45 |
|
58 |
|
46 |
public CollectionFormContenu(Formulaire formulaireCourrant) {
|
59 |
public CollectionFormContenu(Formulaire formulaireCourrant) {
|
47 |
initialiserOnglet(formulaireCourrant);
|
60 |
initialiserOnglet(formulaireCourrant);
|
48 |
setId("contenu");
|
61 |
setId("contenu");
|
49 |
setText(Mediateur.i18nC.collectionContenu());
|
62 |
setText(Mediateur.i18nC.collectionContenu());
|
50 |
|
63 |
|
51 |
creerFieldsetNature();
|
64 |
creerFieldsetNature();
|
52 |
// TODO : réaliser un champ couverture géographique détaillé
|
65 |
// TODO : réaliser un champ couverture géographique détaillé
|
53 |
creerFieldsetPeriode();
|
66 |
creerFieldsetPeriode();
|
54 |
creerFieldsetClassement();
|
67 |
creerFieldsetClassement();
|
55 |
creerFieldsetEtiquette();
|
68 |
creerFieldsetEtiquette();
|
56 |
creerFieldsetIntegration();
|
69 |
creerFieldsetIntegration();
|
57 |
}
|
70 |
}
|
58 |
|
71 |
|
59 |
private void creerFieldsetNature() {
|
72 |
private void creerFieldsetNature() {
|
60 |
FieldSet natureFieldSet = new FieldSet();
|
73 |
FieldSet natureFieldSet = new FieldSet();
|
61 |
natureFieldSet.setHeading("Nature");
|
74 |
natureFieldSet.setHeading("Nature");
|
62 |
natureFieldSet.setCollapsible(true);
|
75 |
natureFieldSet.setCollapsible(true);
|
63 |
natureFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
76 |
natureFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
64 |
|
77 |
|
65 |
natureChp = new ChampCaseACocher(i18nC.natureVegetaleContenu(), "natureVegetale", false);
|
78 |
natureChp = new ChampCaseACocher(i18nC.natureVegetaleContenu(), "natureVegetale", false);
|
66 |
natureFieldSet.add(natureChp);
|
79 |
natureFieldSet.add(natureChp);
|
67 |
|
80 |
|
68 |
specialiteChp = new TextArea();
|
81 |
specialiteChp = new TextArea();
|
69 |
specialiteChp.setFieldLabel(i18nC.specialiteCollection());
|
82 |
specialiteChp.setFieldLabel(i18nC.specialiteCollection());
|
70 |
specialiteChp.setToolTip(i18nC.specialiteCollectionInfo());
|
83 |
specialiteChp.setToolTip(i18nC.specialiteCollectionInfo());
|
71 |
natureFieldSet.add(specialiteChp, new FormData(550, 0));
|
84 |
natureFieldSet.add(specialiteChp, new FormData(550, 0));
|
72 |
|
85 |
|
73 |
add(natureFieldSet);
|
86 |
add(natureFieldSet);
|
74 |
}
|
87 |
}
|
75 |
|
88 |
|
76 |
private void creerFieldsetPeriode() {
|
89 |
private void creerFieldsetPeriode() {
|
77 |
FieldSet periodeFieldSet = new FieldSet();
|
90 |
FieldSet periodeFieldSet = new FieldSet();
|
78 |
periodeFieldSet.setHeading("Période de constitution");
|
91 |
periodeFieldSet.setHeading("Période de constitution");
|
79 |
periodeFieldSet.setCollapsible(true);
|
92 |
periodeFieldSet.setCollapsible(true);
|
80 |
periodeFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
93 |
periodeFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
81 |
|
94 |
|
82 |
periodeConstitutionChp = new ChampCaseACocher(i18nC.periodeConstitution(), "siecleNaturaliste", false);
|
95 |
periodeConstitutionChp = new ChampCaseACocher(i18nC.periodeConstitution(), "siecleNaturaliste", false);
|
83 |
periodeFieldSet.add(periodeConstitutionChp);
|
96 |
periodeFieldSet.add(periodeConstitutionChp);
|
84 |
|
97 |
|
85 |
ConteneurMultiChamps dateDebutConteneur = new ConteneurMultiChamps(i18nC.dateDebutCollection());
|
98 |
ConteneurMultiChamps dateDebutConteneur = new ConteneurMultiChamps(i18nC.dateDebutCollection());
|
86 |
|
99 |
|
87 |
dateDebutChp = new DateField();
|
100 |
dateDebutChp = new DateField();
|
88 |
dateDebutConteneur.ajouterChamp(dateDebutChp, new HBoxLayoutData(new Margins(0, 20, 0, 0)));
|
101 |
dateDebutConteneur.ajouterChamp(dateDebutChp, new HBoxLayoutData(new Margins(0, 20, 0, 0)));
|
89 |
|
102 |
|
90 |
dateDebutCombo = new ChampComboBoxListeValeurs(null, "dateDebut");
|
103 |
dateDebutCombo = new ChampComboBoxListeValeurs(null, "dateDebut");
|
91 |
dateDebutCombo.setTrie("id_valeur");
|
104 |
dateDebutCombo.setTrie("id_valeur");
|
92 |
dateDebutConteneur.ajouterChamp(dateDebutCombo);
|
105 |
dateDebutConteneur.ajouterChamp(dateDebutCombo);
|
93 |
|
106 |
|
94 |
periodeFieldSet.add(dateDebutConteneur);
|
107 |
periodeFieldSet.add(dateDebutConteneur);
|
95 |
|
108 |
|
96 |
ConteneurMultiChamps dateFinConteneur = new ConteneurMultiChamps(i18nC.dateFinCollection());
|
109 |
ConteneurMultiChamps dateFinConteneur = new ConteneurMultiChamps(i18nC.dateFinCollection());
|
97 |
|
110 |
|
98 |
dateFinChp = new DateField();
|
111 |
dateFinChp = new DateField();
|
99 |
dateFinConteneur.ajouterChamp(dateFinChp, new HBoxLayoutData(new Margins(0, 20, 0, 0)));
|
112 |
dateFinConteneur.ajouterChamp(dateFinChp, new HBoxLayoutData(new Margins(0, 20, 0, 0)));
|
100 |
|
113 |
|
101 |
dateFinCombo = new ChampComboBoxListeValeurs(null, "dateFin");
|
114 |
dateFinCombo = new ChampComboBoxListeValeurs(null, "dateFin");
|
102 |
dateFinCombo.setTrie("id_valeur");
|
115 |
dateFinCombo.setTrie("id_valeur");
|
103 |
dateFinConteneur.ajouterChamp(dateFinCombo);
|
116 |
dateFinConteneur.ajouterChamp(dateFinCombo);
|
104 |
|
117 |
|
105 |
periodeFieldSet.add(dateFinConteneur);
|
118 |
periodeFieldSet.add(dateFinConteneur);
|
106 |
|
119 |
|
107 |
add(periodeFieldSet);
|
120 |
add(periodeFieldSet);
|
108 |
}
|
121 |
}
|
109 |
|
122 |
|
110 |
private void creerFieldsetClassement() {
|
123 |
private void creerFieldsetClassement() {
|
111 |
FieldSet classementFieldSet = new FieldSet();
|
124 |
FieldSet classementFieldSet = new FieldSet();
|
112 |
classementFieldSet.setHeading("Classement");
|
125 |
classementFieldSet.setHeading("Classement");
|
113 |
classementFieldSet.setCollapsible(true);
|
126 |
classementFieldSet.setCollapsible(true);
|
114 |
classementFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
127 |
classementFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
115 |
|
128 |
|
116 |
etatClassementCombo = new ChampComboBoxListeValeurs(i18nC.etatClassementCollection(), "etat", tabIndex++);
|
129 |
etatClassementCombo = new ChampComboBoxListeValeurs(i18nC.etatClassementCollection(), "etat", tabIndex++);
|
117 |
classementFieldSet.add(etatClassementCombo);
|
130 |
classementFieldSet.add(etatClassementCombo);
|
118 |
|
131 |
|
119 |
annotationClassementChp = new TextArea();
|
132 |
annotationClassementChp = new TextArea();
|
120 |
annotationClassementChp.setFieldLabel(i18nC.annotationClassementCollection());
|
133 |
annotationClassementChp.setFieldLabel(i18nC.annotationClassementCollection());
|
121 |
classementFieldSet.add(annotationClassementChp, new FormData(550, 0));
|
134 |
classementFieldSet.add(annotationClassementChp, new FormData(550, 0));
|
122 |
|
135 |
|
123 |
Text infoClassement = new Text(i18nC.annotationClassementCollectionInfo());
|
136 |
Text infoClassement = new Text(i18nC.annotationClassementCollectionInfo());
|
124 |
classementFieldSet.add(infoClassement);
|
137 |
classementFieldSet.add(infoClassement);
|
125 |
|
138 |
|
126 |
add(classementFieldSet);
|
139 |
add(classementFieldSet);
|
127 |
}
|
140 |
}
|
128 |
|
141 |
|
129 |
private void creerFieldsetEtiquette() {
|
142 |
private void creerFieldsetEtiquette() {
|
130 |
FieldSet etiquetteFieldSet = new FieldSet();
|
143 |
FieldSet etiquetteFieldSet = new FieldSet();
|
131 |
etiquetteFieldSet.setHeading("Étiquette");
|
144 |
etiquetteFieldSet.setHeading("Étiquette");
|
132 |
etiquetteFieldSet.setCollapsible(true);
|
145 |
etiquetteFieldSet.setCollapsible(true);
|
133 |
etiquetteFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
146 |
etiquetteFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
134 |
|
147 |
|
135 |
Text renseignementPoucentLabel = new Text(i18nC.renseignementEtiquetteCollection());
|
148 |
Text renseignementPoucentLabel = new Text(i18nC.renseignementEtiquetteCollection());
|
136 |
renseignementPoucentLabel.setTagName("label");
|
149 |
renseignementPoucentLabel.setTagName("label");
|
137 |
renseignementPoucentLabel.setStyleName("x-form-item-label");
|
150 |
renseignementPoucentLabel.setStyleName("x-form-item-label");
|
138 |
etiquetteFieldSet.add(renseignementPoucentLabel);
|
151 |
etiquetteFieldSet.add(renseignementPoucentLabel);
|
139 |
|
152 |
|
140 |
auteurTitrePourcentChp = new ChampSliderPourcentage(i18nC.auteurTitrePourcentCollection());
|
153 |
auteurTitrePourcentChp = new ChampSliderPourcentage(i18nC.auteurTitrePourcentCollection());
|
141 |
etiquetteFieldSet.add(auteurTitrePourcentChp, new FormData(200, 0));
|
154 |
etiquetteFieldSet.add(auteurTitrePourcentChp, new FormData(200, 0));
|
142 |
|
155 |
|
143 |
famillePourcentChp = new ChampSliderPourcentage(i18nC.famillePourcentCollection());
|
156 |
famillePourcentChp = new ChampSliderPourcentage(i18nC.famillePourcentCollection());
|
144 |
etiquetteFieldSet.add(famillePourcentChp, new FormData(200, 0));
|
157 |
etiquetteFieldSet.add(famillePourcentChp, new FormData(200, 0));
|
145 |
|
158 |
|
146 |
genrePourcentChp = new ChampSliderPourcentage(i18nC.genrePourcentCollection());
|
159 |
genrePourcentChp = new ChampSliderPourcentage(i18nC.genrePourcentCollection());
|
147 |
etiquetteFieldSet.add(genrePourcentChp, new FormData(200, 0));
|
160 |
etiquetteFieldSet.add(genrePourcentChp, new FormData(200, 0));
|
148 |
|
161 |
|
149 |
spPourcentChp = new ChampSliderPourcentage(i18nC.spPourcentCollection());
|
162 |
spPourcentChp = new ChampSliderPourcentage(i18nC.spPourcentCollection());
|
150 |
etiquetteFieldSet.add(spPourcentChp, new FormData(200, 0));
|
163 |
etiquetteFieldSet.add(spPourcentChp, new FormData(200, 0));
|
151 |
|
164 |
|
152 |
auteurSpPourcentChp = new ChampSliderPourcentage(i18nC.auteurSpPourcentCollection());
|
165 |
auteurSpPourcentChp = new ChampSliderPourcentage(i18nC.auteurSpPourcentCollection());
|
153 |
etiquetteFieldSet.add(auteurSpPourcentChp, new FormData(200, 0));
|
166 |
etiquetteFieldSet.add(auteurSpPourcentChp, new FormData(200, 0));
|
154 |
|
167 |
|
155 |
localitePourcentChp = new ChampSliderPourcentage(i18nC.localitePourcentCollection());
|
168 |
localitePourcentChp = new ChampSliderPourcentage(i18nC.localitePourcentCollection());
|
156 |
etiquetteFieldSet.add(localitePourcentChp, new FormData(200, 0));
|
169 |
etiquetteFieldSet.add(localitePourcentChp, new FormData(200, 0));
|
157 |
|
170 |
|
158 |
datePourcentChp = new ChampSliderPourcentage(i18nC.datePourcentCollection());
|
171 |
datePourcentChp = new ChampSliderPourcentage(i18nC.datePourcentCollection());
|
159 |
etiquetteFieldSet.add(datePourcentChp, new FormData(200, 0));
|
172 |
etiquetteFieldSet.add(datePourcentChp, new FormData(200, 0));
|
160 |
|
173 |
|
161 |
precisionLocaliteCombo = new ChampComboBoxListeValeurs(i18nC.precisionLocaliteCollection(), "onep", tabIndex++);
|
174 |
precisionLocaliteCombo = new ChampComboBoxListeValeurs(i18nC.precisionLocaliteCollection(), "onep", tabIndex++);
|
162 |
etiquetteFieldSet.add(precisionLocaliteCombo);
|
175 |
etiquetteFieldSet.add(precisionLocaliteCombo);
|
163 |
|
176 |
|
164 |
precisionDateCombo = new ChampComboBoxListeValeurs(i18nC.precisionDateCollection(), "onep", tabIndex++);
|
177 |
precisionDateCombo = new ChampComboBoxListeValeurs(i18nC.precisionDateCollection(), "onep", tabIndex++);
|
165 |
etiquetteFieldSet.add(precisionDateCombo);
|
178 |
etiquetteFieldSet.add(precisionDateCombo);
|
166 |
|
179 |
|
167 |
etiquetteAnnotationChp = new TextArea();
|
180 |
etiquetteAnnotationChp = new TextArea();
|
168 |
etiquetteAnnotationChp.setFieldLabel(i18nC.etiquetteAnnotationCollection());
|
181 |
etiquetteAnnotationChp.setFieldLabel(i18nC.etiquetteAnnotationCollection());
|
169 |
etiquetteAnnotationChp.setToolTip(i18nC.etiquetteAnnotationCollectionInfo());
|
182 |
etiquetteAnnotationChp.setToolTip(i18nC.etiquetteAnnotationCollectionInfo());
|
170 |
etiquetteFieldSet.add(etiquetteAnnotationChp, new FormData(550, 0));
|
183 |
etiquetteFieldSet.add(etiquetteAnnotationChp, new FormData(550, 0));
|
171 |
|
184 |
|
172 |
add(etiquetteFieldSet);
|
185 |
add(etiquetteFieldSet);
|
173 |
}
|
186 |
}
|
- |
|
187 |
|
- |
|
188 |
private String collecterEtiquetteRenseignement() {
|
- |
|
189 |
String renseignement = "";
|
- |
|
190 |
renseignement += creerTypeValeur("AT", auteurTitrePourcentChp.getValeur());
|
- |
|
191 |
renseignement += creerTypeValeur("F", famillePourcentChp.getValeur());
|
- |
|
192 |
renseignement += creerTypeValeur("G", genrePourcentChp.getValeur());
|
- |
|
193 |
renseignement += creerTypeValeur("SP", spPourcentChp.getValeur());
|
- |
|
194 |
renseignement += creerTypeValeur("ASP", auteurSpPourcentChp.getValeur());
|
- |
|
195 |
renseignement += creerTypeValeur("L", localitePourcentChp.getValeur());
|
- |
|
196 |
renseignement += creerTypeValeur("D", datePourcentChp.getValeur());
|
- |
|
197 |
renseignement = renseignement.replaceFirst(aDonnee.SEPARATEUR_VALEURS+"$", "");
|
- |
|
198 |
return renseignement;
|
- |
|
199 |
}
|
- |
|
200 |
|
- |
|
201 |
private String creerTypeValeur(String type, String valeur) {
|
- |
|
202 |
String retour = "";
|
- |
|
203 |
if (!UtilString.isEmpty(valeur)) {
|
- |
|
204 |
retour = type+aDonnee.SEPARATEUR_TYPE_VALEUR+valeur+aDonnee.SEPARATEUR_VALEURS;
|
- |
|
205 |
}
|
- |
|
206 |
return retour;
|
- |
|
207 |
}
|
- |
|
208 |
|
- |
|
209 |
private void peuplerEtiquetteRenseignement(String valeurTruk) {
|
- |
|
210 |
HashMap<String,String> infos = parserEtiquetteRenseignement(valeurTruk);
|
- |
|
211 |
if (infos != null) {
|
- |
|
212 |
Iterator<String> it = infos.keySet().iterator();
|
- |
|
213 |
while (it.hasNext()) {
|
- |
|
214 |
String cle = it.next();
|
- |
|
215 |
if (cle.equals("AT")) {
|
- |
|
216 |
auteurTitrePourcentChp.peupler(infos.get(cle));
|
- |
|
217 |
} else if (cle.equals("F")) {
|
- |
|
218 |
famillePourcentChp.peupler(infos.get(cle));
|
- |
|
219 |
} else if (cle.equals("G")) {
|
- |
|
220 |
genrePourcentChp.peupler(infos.get(cle));
|
- |
|
221 |
} else if (cle.equals("SP")) {
|
- |
|
222 |
spPourcentChp.peupler(infos.get(cle));
|
- |
|
223 |
} else if (cle.equals("ASP")) {
|
- |
|
224 |
auteurSpPourcentChp.peupler(infos.get(cle));
|
- |
|
225 |
} else if (cle.equals("L")) {
|
- |
|
226 |
localitePourcentChp.peupler(infos.get(cle));
|
- |
|
227 |
} else if (cle.equals("D")) {
|
- |
|
228 |
genrePourcentChp.peupler(infos.get(cle));
|
- |
|
229 |
}
|
- |
|
230 |
}
|
- |
|
231 |
}
|
- |
|
232 |
}
|
- |
|
233 |
|
- |
|
234 |
private HashMap<String,String> parserEtiquetteRenseignement(String valeurTruk) {
|
- |
|
235 |
HashMap<String,String> infos = null;
|
- |
|
236 |
if (!UtilString.isEmpty(valeurTruk)) {
|
- |
|
237 |
infos = new HashMap<String,String>();
|
- |
|
238 |
String[] pourcentages = valeurTruk.split(Pattern.quote(aDonnee.SEPARATEUR_VALEURS));
|
- |
|
239 |
for (int i = 0; i < pourcentages.length; i++) {
|
- |
|
240 |
String[] pourcentageIdValeur = pourcentages[i].split(Pattern.quote(aDonnee.SEPARATEUR_TYPE_VALEUR));
|
- |
|
241 |
String id = pourcentageIdValeur[0];
|
- |
|
242 |
String valeur = pourcentageIdValeur[1];
|
- |
|
243 |
infos.put(id, valeur);
|
- |
|
244 |
}
|
- |
|
245 |
}
|
- |
|
246 |
return infos;
|
- |
|
247 |
}
|
174 |
|
248 |
|
175 |
private void creerFieldsetIntegration() {
|
249 |
private void creerFieldsetIntegration() {
|
176 |
FieldSet integrationFieldSet = new FieldSet();
|
250 |
FieldSet integrationFieldSet = new FieldSet();
|
177 |
integrationFieldSet.setHeading("Collections intégrées");
|
251 |
integrationFieldSet.setHeading("Collections intégrées");
|
178 |
integrationFieldSet.setCollapsible(true);
|
252 |
integrationFieldSet.setCollapsible(true);
|
179 |
integrationFieldSet.setLayout(Formulaire.creerFormLayout(350, alignementLabelDefaut));
|
253 |
integrationFieldSet.setLayout(Formulaire.creerFormLayout(350, alignementLabelDefaut));
|
180 |
|
254 |
|
181 |
integreCollectionCombo = new ChampComboBoxListeValeurs(i18nC.integreCollection(), "onpi", tabIndex++);
|
255 |
integreCollectionCombo = new ChampComboBoxListeValeurs(i18nC.integreCollection(), "onpi", tabIndex++);
|
182 |
integrationFieldSet.add(integreCollectionCombo);
|
256 |
integrationFieldSet.add(integreCollectionCombo);
|
183 |
|
257 |
|
184 |
infoIntegreCollectionCombo = new ChampComboBoxListeValeurs(i18nC.infoIntegreCollection(), "onp", tabIndex++);
|
258 |
infoIntegreCollectionCombo = new ChampComboBoxListeValeurs(i18nC.infoIntegreCollection(), "onp", tabIndex++);
|
185 |
integrationFieldSet.add(infoIntegreCollectionCombo);
|
259 |
integrationFieldSet.add(infoIntegreCollectionCombo);
|
186 |
|
260 |
|
187 |
Text infoIntegration = new Text(i18nC.infoIntegrationCollection());
|
261 |
Text infoIntegration = new Text(i18nC.infoIntegrationCollection());
|
188 |
integrationFieldSet.add(infoIntegration);
|
262 |
integrationFieldSet.add(infoIntegration);
|
189 |
|
263 |
|
190 |
add(integrationFieldSet);
|
264 |
add(integrationFieldSet);
|
191 |
}
|
265 |
}
|
192 |
|
266 |
|
- |
|
267 |
public void peupler() {
|
193 |
public void rafraichir(Object nouvellesDonnees) {
|
268 |
initialiserCollection();
|
194 |
if (nouvellesDonnees instanceof ValeurListe) {
|
269 |
if (collectionBotanique != null) {
|
195 |
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
|
270 |
natureChp.peupler(collectionBotaniqueCollectee.getNature());
|
- |
|
271 |
specialiteChp.setValue(collectionBotaniqueCollectee.getSpecialite());
|
- |
|
272 |
|
- |
|
273 |
periodeConstitutionChp.peupler(collectionCollectee.getPeriodeConstitution());
|
- |
|
274 |
dateDebutChp.setValue(UtilString.formaterEnDate(collectionBotaniqueCollectee.getRecolteDateDebut()));
|
- |
|
275 |
dateDebutCombo.peupler(collectionBotaniqueCollectee.getRecolteDateDebutType());
|
- |
|
276 |
dateFinChp.setValue(UtilString.formaterEnDate(collectionBotaniqueCollectee.getRecolteDateFin()));
|
196 |
rafraichirValeurListe(listeValeurs);
|
277 |
dateFinCombo.peupler(collectionBotaniqueCollectee.getRecolteDateFinType());
|
- |
|
278 |
|
197 |
} else {
|
279 |
etatClassementCombo.peupler(collectionBotaniqueCollectee.getClassementEtat());
|
- |
|
280 |
annotationClassementChp.setValue(collectionBotaniqueCollectee.getClassementAnnotation());
|
- |
|
281 |
|
- |
|
282 |
peuplerEtiquetteRenseignement(collectionBotaniqueCollectee.getEtiquetteRenseignement());
|
- |
|
283 |
precisionLocaliteCombo.peupler(collectionBotaniqueCollectee.getPrecisionLocalite());
|
- |
|
284 |
precisionDateCombo.peupler(collectionBotaniqueCollectee.getPrecisionDate());
|
- |
|
285 |
etiquetteAnnotationChp.setValue(collectionBotaniqueCollectee.getAnnotationsDiverses());
|
- |
|
286 |
|
- |
|
287 |
integreCollectionCombo.peupler(collectionBotaniqueCollectee.getCollectionIntegre());
|
198 |
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
|
288 |
infoIntegreCollectionCombo.peupler(collectionBotaniqueCollectee.getCollectionIntegreInfo());
|
199 |
}
|
289 |
}
|
200 |
}
|
290 |
}
|
- |
|
291 |
|
- |
|
292 |
public void collecter() {
|
- |
|
293 |
initialiserCollection();
|
201 |
|
294 |
if (etreAccede()) {
|
202 |
private void rafraichirValeurListe(ValeurListe listeValeurs) {
|
295 |
collectionBotaniqueCollectee.setNature(natureChp.getValeur());
|
- |
|
296 |
collectionBotaniqueCollectee.setSpecialite(specialiteChp.getValue());
|
- |
|
297 |
|
- |
|
298 |
collectionCollectee.setPeriodeConstitution(periodeConstitutionChp.getValeur());
|
- |
|
299 |
collectionBotaniqueCollectee.setRecolteDateDebut(UtilDate.formaterEnString(dateDebutChp.getValue()));
|
- |
|
300 |
collectionBotaniqueCollectee.setRecolteDateDebutType(dateDebutCombo.getValeur());
|
- |
|
301 |
collectionBotaniqueCollectee.setRecolteDateFin(UtilDate.formaterEnString(dateFinChp.getValue()));
|
- |
|
302 |
collectionBotaniqueCollectee.setRecolteDateFinType(dateFinCombo.getValeur());
|
- |
|
303 |
|
- |
|
304 |
collectionBotaniqueCollectee.setClassementEtat(etatClassementCombo.getValeur());
|
- |
|
305 |
collectionBotaniqueCollectee.setClassementAnnotation(annotationClassementChp.getValue());
|
- |
|
306 |
|
- |
|
307 |
collectionBotaniqueCollectee.setEtiquetteRenseignement(collecterEtiquetteRenseignement());
|
- |
|
308 |
collectionBotaniqueCollectee.setPrecisionLocalite(precisionLocaliteCombo.getValeur());
|
- |
|
309 |
collectionBotaniqueCollectee.setPrecisionDate(precisionDateCombo.getValeur());
|
- |
|
310 |
collectionBotaniqueCollectee.setAnnotationsDiverses(etiquetteAnnotationChp.getValue());
|
- |
|
311 |
|
203 |
if (listeValeurs.getId().equals(config.getListeId(""))) {
|
312 |
collectionBotaniqueCollectee.setCollectionIntegre(integreCollectionCombo.getValeur());
|
- |
|
313 |
collectionBotaniqueCollectee.setCollectionIntegreInfo(infoIntegreCollectionCombo.getValeur());
|
- |
|
314 |
}
|
- |
|
315 |
}
|
- |
|
316 |
|
- |
|
317 |
private void initialiserCollection() {
|
- |
|
318 |
collection = ((CollectionForm) formulaire).collection;
|
- |
|
319 |
if (collection != null) {
|
- |
|
320 |
collectionBotanique = collection.getBotanique();
|
- |
|
321 |
}
|
- |
|
322 |
|
204 |
|
323 |
collectionCollectee = ((CollectionForm) formulaire).collectionCollectee;
|
205 |
} else {
|
324 |
if (collectionCollectee != null) {
|
206 |
GWT.log("Gestion de la liste "+listeValeurs.getId()+" non implémenté!", null);
|
325 |
collectionBotaniqueCollectee = collectionCollectee.getBotanique();
|
- |
|
326 |
}
|
- |
|
327 |
}
|
- |
|
328 |
|
- |
|
329 |
public void rafraichir(Object nouvellesDonnees) {
|
207 |
}
|
330 |
Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
|
208 |
}
|
331 |
}
|
209 |
}
|
332 |
}
|