New file |
0,0 → 1,209 |
package org.tela_botanica.client.vues.collection; |
|
import org.tela_botanica.client.Mediateur; |
import org.tela_botanica.client.composants.ChampCaseACocher; |
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs; |
import org.tela_botanica.client.composants.ChampSliderPourcentage; |
import org.tela_botanica.client.composants.ConteneurMultiChamps; |
import org.tela_botanica.client.interfaces.Rafraichissable; |
import org.tela_botanica.client.modeles.ValeurListe; |
import org.tela_botanica.client.vues.Formulaire; |
import org.tela_botanica.client.vues.FormulaireOnglet; |
|
import com.extjs.gxt.ui.client.util.Margins; |
import com.extjs.gxt.ui.client.widget.Text; |
import com.extjs.gxt.ui.client.widget.form.DateField; |
import com.extjs.gxt.ui.client.widget.form.FieldSet; |
import com.extjs.gxt.ui.client.widget.form.TextArea; |
import com.extjs.gxt.ui.client.widget.layout.FormData; |
import com.extjs.gxt.ui.client.widget.layout.HBoxLayoutData; |
import com.google.gwt.core.client.GWT; |
|
public class CollectionFormContenu extends FormulaireOnglet implements Rafraichissable { |
|
private ChampCaseACocher natureChp = null; |
private TextArea specialiteChp = null; |
private ChampCaseACocher periodeConstitutionChp = null; |
private ChampComboBoxListeValeurs dateDebutCombo = null; |
private ChampComboBoxListeValeurs dateFinCombo = null; |
private DateField dateDebutChp = null; |
private DateField dateFinChp = null; |
private TextArea annotationClassementChp = null; |
private ChampComboBoxListeValeurs etatClassementCombo = null; |
private ChampComboBoxListeValeurs precisionDateCombo = null; |
private ChampComboBoxListeValeurs precisionLocaliteCombo = null; |
private TextArea etiquetteAnnotationChp = null; |
private ChampComboBoxListeValeurs integreCollectionCombo = null; |
private ChampComboBoxListeValeurs infoIntegreCollectionCombo = null; |
private ChampSliderPourcentage auteurTitrePourcentChp; |
private ChampSliderPourcentage famillePourcentChp; |
private ChampSliderPourcentage genrePourcentChp; |
private ChampSliderPourcentage spPourcentChp; |
private ChampSliderPourcentage auteurSpPourcentChp; |
private ChampSliderPourcentage localitePourcentChp; |
private ChampSliderPourcentage datePourcentChp; |
|
public CollectionFormContenu(Formulaire formulaireCourrant) { |
initialiserOnglet(formulaireCourrant); |
setId("contenu"); |
setText(Mediateur.i18nC.collectionContenu()); |
|
creerFieldsetNature(); |
// TODO : réaliser un champ couverture géographique détaillé |
creerFieldsetPeriode(); |
creerFieldsetClassement(); |
creerFieldsetEtiquette(); |
creerFieldsetIntegration(); |
} |
|
private void creerFieldsetNature() { |
FieldSet natureFieldSet = new FieldSet(); |
natureFieldSet.setHeading("Nature"); |
natureFieldSet.setCollapsible(true); |
natureFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut)); |
|
natureChp = new ChampCaseACocher(i18nC.natureVegetaleContenu(), "natureVegetale", false); |
natureFieldSet.add(natureChp); |
|
specialiteChp = new TextArea(); |
specialiteChp.setFieldLabel(i18nC.specialiteCollection()); |
specialiteChp.setToolTip(i18nC.specialiteCollectionInfo()); |
natureFieldSet.add(specialiteChp, new FormData(550, 0)); |
|
add(natureFieldSet); |
} |
|
private void creerFieldsetPeriode() { |
FieldSet periodeFieldSet = new FieldSet(); |
periodeFieldSet.setHeading("Période de constitution"); |
periodeFieldSet.setCollapsible(true); |
periodeFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut)); |
|
periodeConstitutionChp = new ChampCaseACocher(i18nC.periodeConstitution(), "siecleNaturaliste", false); |
periodeFieldSet.add(periodeConstitutionChp); |
|
ConteneurMultiChamps dateDebutConteneur = new ConteneurMultiChamps(i18nC.dateDebutCollection()); |
|
dateDebutChp = new DateField(); |
dateDebutConteneur.ajouterChamp(dateDebutChp, new HBoxLayoutData(new Margins(0, 20, 0, 0))); |
|
dateDebutCombo = new ChampComboBoxListeValeurs(null, "dateDebut"); |
dateDebutCombo.setTrie("id_valeur"); |
dateDebutConteneur.ajouterChamp(dateDebutCombo); |
|
periodeFieldSet.add(dateDebutConteneur); |
|
ConteneurMultiChamps dateFinConteneur = new ConteneurMultiChamps(i18nC.dateFinCollection()); |
|
dateFinChp = new DateField(); |
dateFinConteneur.ajouterChamp(dateFinChp, new HBoxLayoutData(new Margins(0, 20, 0, 0))); |
|
dateFinCombo = new ChampComboBoxListeValeurs(null, "dateFin"); |
dateFinCombo.setTrie("id_valeur"); |
dateFinConteneur.ajouterChamp(dateFinCombo); |
|
periodeFieldSet.add(dateFinConteneur); |
|
add(periodeFieldSet); |
} |
|
private void creerFieldsetClassement() { |
FieldSet classementFieldSet = new FieldSet(); |
classementFieldSet.setHeading("Classement"); |
classementFieldSet.setCollapsible(true); |
classementFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut)); |
|
etatClassementCombo = new ChampComboBoxListeValeurs(i18nC.etatClassementCollection(), "etat", tabIndex++); |
classementFieldSet.add(etatClassementCombo); |
|
annotationClassementChp = new TextArea(); |
annotationClassementChp.setFieldLabel(i18nC.annotationClassementCollection()); |
classementFieldSet.add(annotationClassementChp, new FormData(550, 0)); |
|
Text infoClassement = new Text(i18nC.annotationClassementCollectionInfo()); |
classementFieldSet.add(infoClassement); |
|
add(classementFieldSet); |
} |
|
private void creerFieldsetEtiquette() { |
FieldSet etiquetteFieldSet = new FieldSet(); |
etiquetteFieldSet.setHeading("Étiquette"); |
etiquetteFieldSet.setCollapsible(true); |
etiquetteFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut)); |
|
Text renseignementPoucentLabel = new Text(i18nC.renseignementEtiquetteCollection()); |
renseignementPoucentLabel.setTagName("label"); |
renseignementPoucentLabel.setStyleName("x-form-item-label"); |
etiquetteFieldSet.add(renseignementPoucentLabel); |
|
auteurTitrePourcentChp = new ChampSliderPourcentage(i18nC.auteurTitrePourcentCollection()); |
etiquetteFieldSet.add(auteurTitrePourcentChp, new FormData(200, 0)); |
|
famillePourcentChp = new ChampSliderPourcentage(i18nC.famillePourcentCollection()); |
etiquetteFieldSet.add(famillePourcentChp, new FormData(200, 0)); |
|
genrePourcentChp = new ChampSliderPourcentage(i18nC.genrePourcentCollection()); |
etiquetteFieldSet.add(genrePourcentChp, new FormData(200, 0)); |
|
spPourcentChp = new ChampSliderPourcentage(i18nC.spPourcentCollection()); |
etiquetteFieldSet.add(spPourcentChp, new FormData(200, 0)); |
|
auteurSpPourcentChp = new ChampSliderPourcentage(i18nC.auteurSpPourcentCollection()); |
etiquetteFieldSet.add(auteurSpPourcentChp, new FormData(200, 0)); |
|
localitePourcentChp = new ChampSliderPourcentage(i18nC.localitePourcentCollection()); |
etiquetteFieldSet.add(localitePourcentChp, new FormData(200, 0)); |
|
datePourcentChp = new ChampSliderPourcentage(i18nC.datePourcentCollection()); |
etiquetteFieldSet.add(datePourcentChp, new FormData(200, 0)); |
|
precisionLocaliteCombo = new ChampComboBoxListeValeurs(i18nC.precisionLocaliteCollection(), "onep", tabIndex++); |
etiquetteFieldSet.add(precisionLocaliteCombo); |
|
precisionDateCombo = new ChampComboBoxListeValeurs(i18nC.precisionDateCollection(), "onep", tabIndex++); |
etiquetteFieldSet.add(precisionDateCombo); |
|
etiquetteAnnotationChp = new TextArea(); |
etiquetteAnnotationChp.setFieldLabel(i18nC.etiquetteAnnotationCollection()); |
etiquetteAnnotationChp.setToolTip(i18nC.etiquetteAnnotationCollectionInfo()); |
etiquetteFieldSet.add(etiquetteAnnotationChp, new FormData(550, 0)); |
|
add(etiquetteFieldSet); |
} |
|
private void creerFieldsetIntegration() { |
FieldSet integrationFieldSet = new FieldSet(); |
integrationFieldSet.setHeading("Collections intégrées"); |
integrationFieldSet.setCollapsible(true); |
integrationFieldSet.setLayout(Formulaire.creerFormLayout(350, alignementLabelDefaut)); |
|
integreCollectionCombo = new ChampComboBoxListeValeurs(i18nC.integreCollection(), "onpi", tabIndex++); |
integrationFieldSet.add(integreCollectionCombo); |
|
infoIntegreCollectionCombo = new ChampComboBoxListeValeurs(i18nC.infoIntegreCollection(), "onp", tabIndex++); |
integrationFieldSet.add(infoIntegreCollectionCombo); |
|
Text infoIntegration = new Text(i18nC.infoIntegrationCollection()); |
integrationFieldSet.add(infoIntegration); |
|
add(integrationFieldSet); |
} |
|
public void rafraichir(Object nouvellesDonnees) { |
if (nouvellesDonnees instanceof ValeurListe) { |
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees; |
rafraichirValeurListe(listeValeurs); |
} else { |
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null); |
} |
} |
|
private void rafraichirValeurListe(ValeurListe listeValeurs) { |
if (listeValeurs.getId().equals(config.getListeId(""))) { |
|
} else { |
GWT.log("Gestion de la liste "+listeValeurs.getId()+" non implémenté!", null); |
} |
} |
} |