| Line 5... |
Line 5... |
| 5 |
|
5 |
|
| 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.ChampSliderPourcentage;
|
- |
|
| 10 |
import org.tela_botanica.client.composants.ConteneurMultiChamps;
|
9 |
import org.tela_botanica.client.composants.ChampSliderPourcentage;
|
| 11 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
10 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
| 12 |
import org.tela_botanica.client.modeles.aDonnee;
|
11 |
import org.tela_botanica.client.modeles.aDonnee;
|
| 13 |
import org.tela_botanica.client.modeles.collection.Collection;
|
12 |
import org.tela_botanica.client.modeles.collection.Collection;
|
| 14 |
import org.tela_botanica.client.modeles.collection.CollectionBotanique;
|
13 |
import org.tela_botanica.client.modeles.collection.CollectionBotanique;
|
| 15 |
import org.tela_botanica.client.util.Debug;
|
14 |
import org.tela_botanica.client.util.Debug;
|
| 16 |
import org.tela_botanica.client.util.Pattern;
|
- |
|
| 17 |
import org.tela_botanica.client.util.UtilDate;
|
15 |
import org.tela_botanica.client.util.Pattern;
|
| 18 |
import org.tela_botanica.client.util.UtilString;
|
16 |
import org.tela_botanica.client.util.UtilString;
|
| 19 |
import org.tela_botanica.client.vues.Formulaire;
|
17 |
import org.tela_botanica.client.vues.Formulaire;
|
| Line 20... |
Line -... |
| 20 |
import org.tela_botanica.client.vues.FormulaireOnglet;
|
- |
|
| 21 |
|
18 |
import org.tela_botanica.client.vues.FormulaireOnglet;
|
| 22 |
import com.extjs.gxt.ui.client.util.Margins;
|
- |
|
| 23 |
import com.extjs.gxt.ui.client.widget.Text;
|
19 |
|
| 24 |
import com.extjs.gxt.ui.client.widget.form.DateField;
|
20 |
import com.extjs.gxt.ui.client.widget.Text;
|
| 25 |
import com.extjs.gxt.ui.client.widget.form.FieldSet;
|
21 |
import com.extjs.gxt.ui.client.widget.form.FieldSet;
|
| 26 |
import com.extjs.gxt.ui.client.widget.form.TextArea;
|
- |
|
| Line 27... |
Line 22... |
| 27 |
import com.extjs.gxt.ui.client.widget.layout.FormData;
|
22 |
import com.extjs.gxt.ui.client.widget.form.TextArea;
|
| Line 28... |
Line 23... |
| 28 |
import com.extjs.gxt.ui.client.widget.layout.HBoxLayoutData;
|
23 |
import com.extjs.gxt.ui.client.widget.layout.FormData;
|
| 29 |
|
24 |
|
| Line 35... |
Line 30... |
| 35 |
private Collection collectionCollectee = null;
|
30 |
private Collection collectionCollectee = null;
|
| 36 |
private CollectionBotanique collectionBotaniqueCollectee = null;
|
31 |
private CollectionBotanique collectionBotaniqueCollectee = null;
|
| Line 37... |
Line 32... |
| 37 |
|
32 |
|
| 38 |
private ChampCaseACocher natureChp = null;
|
33 |
private ChampCaseACocher natureChp = null;
|
| 39 |
private TextArea specialiteChp = null;
|
- |
|
| 40 |
private ChampComboBoxListeValeurs dateDebutCombo = null;
|
- |
|
| 41 |
private ChampComboBoxListeValeurs dateFinCombo = null;
|
- |
|
| 42 |
private DateField dateDebutChp = null;
|
- |
|
| 43 |
private DateField dateFinChp = null;
|
34 |
private TextArea specialiteChp = null;
|
| 44 |
private TextArea annotationClassementChp = null;
|
35 |
private TextArea annotationClassementChp = null;
|
| 45 |
private ChampComboBoxListeValeurs etatClassementCombo = null;
|
36 |
private ChampComboBoxListeValeurs etatClassementCombo = null;
|
| 46 |
private ChampComboBoxListeValeurs precisionDateCombo = null;
|
37 |
private ChampComboBoxListeValeurs precisionDateCombo = null;
|
| 47 |
private ChampComboBoxListeValeurs precisionLocaliteCombo = null;
|
38 |
private ChampComboBoxListeValeurs precisionLocaliteCombo = null;
|
| Line 61... |
Line 52... |
| 61 |
setId(ID);
|
52 |
setId(ID);
|
| 62 |
setText(Mediateur.i18nC.collectionContenu());
|
53 |
setText(Mediateur.i18nC.collectionContenu());
|
| Line 63... |
Line 54... |
| 63 |
|
54 |
|
| 64 |
creerFieldsetNature();
|
55 |
creerFieldsetNature();
|
| 65 |
// TODO : réaliser un champ couverture géographique détaillé
|
- |
|
| 66 |
creerFieldsetPeriode();
|
56 |
// TODO : réaliser un champ couverture géographique détaillé
|
| 67 |
creerFieldsetClassement();
|
57 |
creerFieldsetClassement();
|
| 68 |
creerFieldsetEtiquette();
|
58 |
creerFieldsetEtiquette();
|
| 69 |
creerFieldsetIntegration();
|
59 |
creerFieldsetIntegration();
|
| Line 84... |
Line 74... |
| 84 |
natureFieldSet.add(specialiteChp, new FormData(550, 0));
|
74 |
natureFieldSet.add(specialiteChp, new FormData(550, 0));
|
| Line 85... |
Line 75... |
| 85 |
|
75 |
|
| 86 |
add(natureFieldSet);
|
76 |
add(natureFieldSet);
|
| Line 87... |
Line -... |
| 87 |
}
|
- |
|
| 88 |
|
- |
|
| 89 |
private void creerFieldsetPeriode() {
|
- |
|
| 90 |
FieldSet periodeFieldSet = new FieldSet();
|
- |
|
| 91 |
periodeFieldSet.setHeadingHtml(i18nC.collectionConstitutionTitre());
|
- |
|
| 92 |
periodeFieldSet.setCollapsible(true);
|
- |
|
| 93 |
periodeFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
- |
|
| 94 |
|
- |
|
| 95 |
ConteneurMultiChamps dateDebutConteneur = new ConteneurMultiChamps(i18nC.dateDebutCollection());
|
- |
|
| 96 |
|
- |
|
| 97 |
dateDebutChp = new DateField();
|
- |
|
| 98 |
dateDebutChp.getPropertyEditor().setFormat(UtilDate.formatDateFr);
|
- |
|
| 99 |
dateDebutChp.getPropertyEditor().setParseStrict(false);
|
- |
|
| 100 |
dateDebutChp.setFormatValue(true);
|
- |
|
| 101 |
dateDebutConteneur.ajouterChamp(dateDebutChp, new HBoxLayoutData(new Margins(0, 20, 0, 0)));
|
- |
|
| 102 |
|
- |
|
| 103 |
dateDebutCombo = new ChampComboBoxListeValeurs(null, "dateDebut");
|
- |
|
| 104 |
dateDebutCombo.setTrie("id_valeur");
|
- |
|
| 105 |
dateDebutConteneur.ajouterChamp(dateDebutCombo);
|
- |
|
| 106 |
|
- |
|
| 107 |
periodeFieldSet.add(dateDebutConteneur);
|
- |
|
| 108 |
|
- |
|
| 109 |
ConteneurMultiChamps dateFinConteneur = new ConteneurMultiChamps(i18nC.dateFinCollection());
|
- |
|
| 110 |
|
- |
|
| 111 |
dateFinChp = new DateField();
|
- |
|
| 112 |
dateFinChp.getPropertyEditor().setFormat(UtilDate.formatDateFr);
|
- |
|
| 113 |
dateFinChp.getPropertyEditor().setParseStrict(false);
|
- |
|
| 114 |
dateFinChp.setFormatValue(true);
|
- |
|
| 115 |
dateFinConteneur.ajouterChamp(dateFinChp, new HBoxLayoutData(new Margins(0, 20, 0, 0)));
|
- |
|
| 116 |
|
- |
|
| 117 |
dateFinCombo = new ChampComboBoxListeValeurs(null, "dateFin");
|
- |
|
| 118 |
dateFinCombo.setTrie("id_valeur");
|
- |
|
| 119 |
dateFinConteneur.ajouterChamp(dateFinCombo);
|
- |
|
| 120 |
|
- |
|
| 121 |
periodeFieldSet.add(dateFinConteneur);
|
- |
|
| 122 |
|
- |
|
| 123 |
Text infoDate = new Text(i18nC.dateApproximativeInfo());
|
77 |
}
|
| 124 |
periodeFieldSet.add(infoDate);
|
- |
|
| 125 |
|
- |
|
| Line 126... |
Line 78... |
| 126 |
add(periodeFieldSet);
|
78 |
|
| 127 |
}
|
79 |
|
| 128 |
|
80 |
|
| 129 |
private void creerFieldsetClassement() {
|
81 |
private void creerFieldsetClassement() {
|
| Line 274... |
Line 226... |
| 274 |
initialiserCollection();
|
226 |
initialiserCollection();
|
| 275 |
if (collectionBotanique != null) {
|
227 |
if (collectionBotanique != null) {
|
| 276 |
natureChp.peupler(collectionBotanique.getNature());
|
228 |
natureChp.peupler(collectionBotanique.getNature());
|
| 277 |
specialiteChp.setValue(collectionBotanique.getSpecialite());
|
229 |
specialiteChp.setValue(collectionBotanique.getSpecialite());
|
| Line 278... |
Line -... |
| 278 |
|
- |
|
| 279 |
dateDebutChp.setValue(UtilString.formaterEnDate(collectionBotanique.getRecolteDateDebut()));
|
- |
|
| 280 |
dateDebutCombo.peupler(collectionBotanique.getRecolteDateDebutType());
|
- |
|
| 281 |
dateFinChp.setValue(UtilString.formaterEnDate(collectionBotanique.getRecolteDateFin()));
|
- |
|
| 282 |
dateFinCombo.peupler(collectionBotanique.getRecolteDateFinType());
|
- |
|
| 283 |
|
230 |
|
| 284 |
etatClassementCombo.peupler(collectionBotanique.getClassementEtat());
|
231 |
etatClassementCombo.peupler(collectionBotanique.getClassementEtat());
|
| Line 285... |
Line 232... |
| 285 |
annotationClassementChp.setValue(collectionBotanique.getClassementAnnotation());
|
232 |
annotationClassementChp.setValue(collectionBotanique.getClassementAnnotation());
|
| 286 |
|
233 |
|
| Line 298... |
Line 245... |
| 298 |
initialiserCollection();
|
245 |
initialiserCollection();
|
| 299 |
if (etreAccede()) {
|
246 |
if (etreAccede()) {
|
| 300 |
collectionBotaniqueCollectee.setNature(natureChp.getValeur());
|
247 |
collectionBotaniqueCollectee.setNature(natureChp.getValeur());
|
| 301 |
collectionBotaniqueCollectee.setSpecialite(specialiteChp.getValue());
|
248 |
collectionBotaniqueCollectee.setSpecialite(specialiteChp.getValue());
|
| Line 302... |
Line -... |
| 302 |
|
- |
|
| 303 |
collectionBotaniqueCollectee.setRecolteDateDebut(UtilDate.formaterEnString(dateDebutChp.getValue()));
|
- |
|
| 304 |
collectionBotaniqueCollectee.setRecolteDateDebutType(dateDebutCombo.getValeur());
|
- |
|
| 305 |
collectionBotaniqueCollectee.setRecolteDateFin(UtilDate.formaterEnString(dateFinChp.getValue()));
|
- |
|
| 306 |
collectionBotaniqueCollectee.setRecolteDateFinType(dateFinCombo.getValeur());
|
- |
|
| 307 |
|
249 |
|
| 308 |
collectionBotaniqueCollectee.setClassementEtat(etatClassementCombo.getValeur());
|
250 |
collectionBotaniqueCollectee.setClassementEtat(etatClassementCombo.getValeur());
|
| Line 309... |
Line 251... |
| 309 |
collectionBotaniqueCollectee.setClassementAnnotation(annotationClassementChp.getValue());
|
251 |
collectionBotaniqueCollectee.setClassementAnnotation(annotationClassementChp.getValue());
|
| 310 |
|
252 |
|