Rev 1327 | Rev 1354 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
package org.tela_botanica.client.vues.structure;import java.util.ArrayList;import java.util.Date;import java.util.Iterator;import java.util.List;import org.tela_botanica.client.ComposantClass;import org.tela_botanica.client.Mediateur;import org.tela_botanica.client.RegistreId;import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;import org.tela_botanica.client.composants.InfoLogger;import org.tela_botanica.client.composants.pagination.ProxyProjets;import org.tela_botanica.client.composants.pagination.ProxyValeur;import org.tela_botanica.client.images.Images;import org.tela_botanica.client.interfaces.Rafraichissable;import org.tela_botanica.client.modeles.Information;import org.tela_botanica.client.modeles.InterneValeur;import org.tela_botanica.client.modeles.InterneValeurListe;import org.tela_botanica.client.modeles.MenuApplicationId;import org.tela_botanica.client.modeles.Valeur;import org.tela_botanica.client.modeles.ValeurListe;import org.tela_botanica.client.modeles.aDonnee;import org.tela_botanica.client.modeles.collection.CollectionAPersonne;import org.tela_botanica.client.modeles.personne.Personne;import org.tela_botanica.client.modeles.personne.PersonneListe;import org.tela_botanica.client.modeles.projet.Projet;import org.tela_botanica.client.modeles.projet.ProjetListe;import org.tela_botanica.client.modeles.structure.Structure;import org.tela_botanica.client.modeles.structure.StructureAPersonne;import org.tela_botanica.client.modeles.structure.StructureAPersonneListe;import org.tela_botanica.client.modeles.structure.StructureConservation;import org.tela_botanica.client.modeles.structure.StructureValorisation;import org.tela_botanica.client.util.Debug;import org.tela_botanica.client.util.Pattern;import org.tela_botanica.client.util.UtilArray;import org.tela_botanica.client.util.UtilString;import org.tela_botanica.client.vues.Formulaire;import com.extjs.gxt.ui.client.Style.Scroll;import com.extjs.gxt.ui.client.data.ModelData;import com.extjs.gxt.ui.client.data.ModelType;import com.extjs.gxt.ui.client.event.Events;import com.extjs.gxt.ui.client.Registry;import com.extjs.gxt.ui.client.event.BaseEvent;import com.extjs.gxt.ui.client.event.ButtonEvent;import com.extjs.gxt.ui.client.event.ComponentEvent;import com.extjs.gxt.ui.client.event.EventType;import com.extjs.gxt.ui.client.event.KeyListener;import com.extjs.gxt.ui.client.event.Listener;import com.extjs.gxt.ui.client.event.SelectionChangedEvent;import com.extjs.gxt.ui.client.event.SelectionChangedListener;import com.extjs.gxt.ui.client.event.SelectionListener;import com.extjs.gxt.ui.client.store.ListStore;import com.extjs.gxt.ui.client.store.Record;import com.extjs.gxt.ui.client.store.Store;import com.extjs.gxt.ui.client.store.StoreEvent;import com.extjs.gxt.ui.client.widget.Component;import com.extjs.gxt.ui.client.widget.ContentPanel;import com.extjs.gxt.ui.client.widget.Html;import com.extjs.gxt.ui.client.widget.Info;import com.extjs.gxt.ui.client.widget.LayoutContainer;import com.extjs.gxt.ui.client.widget.MessageBox;import com.extjs.gxt.ui.client.widget.TabItem;import com.extjs.gxt.ui.client.widget.TabPanel;import com.extjs.gxt.ui.client.widget.button.Button;import com.extjs.gxt.ui.client.widget.form.CheckBox;import com.extjs.gxt.ui.client.widget.form.CheckBoxGroup;import com.extjs.gxt.ui.client.widget.form.ComboBox;import com.extjs.gxt.ui.client.widget.form.DateField;import com.extjs.gxt.ui.client.widget.form.Field;import com.extjs.gxt.ui.client.widget.form.FieldSet;import com.extjs.gxt.ui.client.widget.form.HiddenField;import com.extjs.gxt.ui.client.widget.form.LabelField;import com.extjs.gxt.ui.client.widget.form.NumberField;import com.extjs.gxt.ui.client.widget.form.Radio;import com.extjs.gxt.ui.client.widget.form.RadioGroup;import com.extjs.gxt.ui.client.widget.form.TextArea;import com.extjs.gxt.ui.client.widget.form.TextField;import com.extjs.gxt.ui.client.widget.form.Validator;import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;import com.extjs.gxt.ui.client.widget.grid.CellEditor;import com.extjs.gxt.ui.client.widget.grid.CheckColumnConfig;import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;import com.extjs.gxt.ui.client.widget.grid.ColumnModel;import com.extjs.gxt.ui.client.widget.grid.EditorGrid;import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;import com.extjs.gxt.ui.client.widget.grid.RowNumberer;import com.extjs.gxt.ui.client.widget.layout.ColumnData;import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;import com.extjs.gxt.ui.client.widget.layout.FitLayout;import com.extjs.gxt.ui.client.widget.layout.FormData;import com.extjs.gxt.ui.client.widget.tips.ToolTipConfig;import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;import com.google.gwt.core.client.GWT;import com.google.gwt.i18n.client.DateTimeFormat;import com.google.gwt.i18n.client.NumberFormat;import com.google.gwt.user.client.Window;public class StructureForm extends Formulaire implements Rafraichissable {private static int decompteRafraichissementPersonnel = 0;private TabPanel onglets = null;private TabItem identificationOnglet = null;private TabItem personnelOnglet = null;private TabItem conservationOnglet = null;private TabItem valorisationOnglet = null;private HiddenField<String> idStructureChp = null;// Onglet IDENTIFICATIONprivate Structure identification = null;private ListStore<Valeur> magazinLstpr = null;private ComboBox<Valeur> comboLstpr = null;private ListStore<Valeur> magazinLstpu = null;private ComboBox<Valeur> comboLstpu = null;private ListStore<Valeur> magazinLiStatut = null;private ComboBox<Valeur> comboLiStatut = null;private ListStore<Valeur> fonctionsMagazin = null;private ComboBox<Valeur> fonctionsCombo = null;private ComboBox<InterneValeur> comboAcronyme = null;private TextField<String> ihChp = null;private TextField<String> mnhnChp = null;private ComboBox<InterneValeur> comboTypeStructure = null;private TextField<String> nomStructureChp = null;private TextField<String> dateFondationChp = null;private TextArea descriptionChp = null;private TextArea conditionAccesChp = null;private TextArea conditionUsageChp = null;private TextArea adrChp = null;private TextArea adrComplementChp = null;private TextField<String> cpChp = null;private TextField<String> villeChp = null;private ListStore<Valeur> magazinRegion = null;private ComboBox<Valeur> comboRegion = null;private ListStore<Valeur> magazinPays = null;private ChampComboBoxRechercheTempsReelPaginable comboPays = null;private TextField<String> latitudeChp = null;private TextField<String> longitudeChp = null;private TextField<String> telChp = null;private TextField<String> faxChp = null;private TextField<String> emailChp = null;private TextField<String> urlChp = null;// Onglet PERSONNELprivate StructureAPersonneListe personnel = null;private StructureAPersonneListe personnelAjoute = null;private StructureAPersonneListe personnelModifie = null;private StructureAPersonneListe personnelSupprime = null;private NumberField nbreTotalPersonneStructureChp = null;private EditorGrid<StructureAPersonne> grillePersonnel = null;private ListStore<StructureAPersonne> personnelGrilleMagazin = null;// Onglet CONSERVATIONprivate StructureConservation conservation = null;private RadioGroup formationMarkRGrpChp = null;private RadioGroup interetFormationMarkRGrpChp = null;private RadioGroup collectionCommuneMarkRGrpChp = null;private RadioGroup accesControleMarkRGrpChp = null;private RadioGroup restaurationMarkRGrpChp = null;private RadioGroup traitementMarkRGrpChp = null;private RadioGroup collectionAcquisitionMarkRGrpChp = null;private RadioGroup echantillonAcquisitionMarkRGrpChp = null;private TextField<String> localStockageAutreChp = null;private TextField<String> meubleStockageAutreChp = null;private TextField<String> parametreStockageAutreChp = null;private TextField<String> collectionAutreAutreChp = null;private TextField<String> autreCollectionAutreChp = null;private TextField<String> opRestauAutreChp = null;private TextField<String> autreMaterielAutreChp = null;private TextField<String> poisonTraitementAutreChp = null;private TextField<String> traitementAutreChp = null;private TextField<String> insecteTraitementAutreChp = null;private TextField<String> actionAutreChp = null;private TextField<String> provenanceRechercheAutreChp = null;private TextField<String> typeRechercheAutreChp = null;private CheckBoxGroup localStockageTrukCacGrpChp = null;private LayoutContainer localStockageTrukCp = null;private CheckBoxGroup meubleStockageTrukCacGrpChp = null;private LayoutContainer meubleStockageTrukCp = null;private CheckBoxGroup parametreStockageTrukCacGrpChp = null;private LayoutContainer parametreStockageTrukCp = null;private LayoutContainer collectionAutreTrukCp = null;private CheckBoxGroup collectionAutreTrukCacGrpChp = null;private CheckBoxGroup opRestauTrukCacGrpChp = null;private LayoutContainer opRestauTrukCp = null;private CheckBoxGroup autreMaterielTrukCacGrpChp = null;private LayoutContainer autreMaterielTrukCp = null;private LayoutContainer traitementTrukCp = null;private CheckBoxGroup traitementTrukCacGrpChp = null;private LayoutContainer poisonTraitementTrukCp = null;private LayoutContainer insecteTraitementTrukCp = null;private CheckBoxGroup insecteTraitementTrukCacGrpChp = null;private CheckBoxGroup poisonTraitementTrukCacGrpChp = null;private LayoutContainer autreCollectionTrukCp = null;private CheckBoxGroup autreCollectionTrukCacGrpChp = null;private LayoutContainer provenanceRechercheTrukCp = null;private CheckBoxGroup provenanceRechercheTrukCacGrpChp = null;private CheckBoxGroup typeRechercheTrukCacGrpChp = null;private LayoutContainer typeRechercheTrukCp = null;private TextField<String> futureActionChp = null;private TextField<String> sansMotifAccesChp = null;private TextField<String> avecMotifAccesChp = null;private TextField<String> formationChp = null;private RadioGroup traitementAcquisitionMarkRGrpChp = null;private LabelField traitementAcquisitionMarkLabel = null;private RadioGroup materielConservationCeRGrpChp = null;// Onglet VALORISATIONprivate StructureValorisation valorisation = null;private RadioGroup actionMarkRGrpChp = null;private LayoutContainer actionTrukCp = null;private CheckBoxGroup actionTrukCacGrpChp = null;private RadioGroup futureActionMarkRGrpChp = null;private RadioGroup rechercheMarkRGrpChp = null;private RadioGroup sansMotifAccesMarkRGrpChp = null;private RadioGroup avecMotifAccesMarkRGrpChp = null;private TextField<String> publicationChp = null;private LayoutContainer materielConservationCp = null;private ListStore<Personne> personneExistanteMagazin = null;private ComboBox<Personne> personneExistanteCombo = null;private Button supprimerPersonnelBtn = null;private ListStore<Projet> projetsMagazin = null;private ChampComboBoxRechercheTempsReelPaginable projetsCombo = null;private CellEditor fonctionEditor = null;private List<Valeur> fonctionsListe = null;public StructureForm(Mediateur mediateurCourrant, String modeDeCreation) {initialiserFormulaire(mediateurCourrant, modeDeCreation, MenuApplicationId.STRUCTURE);// Ajout du titrepanneauFormulaire.setHeading(i18nC.titreAjoutFormStructurePanneau());// Création des ongletsonglets = creerOnglets();// Ajout des onglets au formulaire généralpanneauFormulaire.add(onglets);}protected TabPanel creerOnglets() {TabPanel ongletsStructure = new TabPanel();// NOTE : pour faire apparaître les scrollBar il faut définir la hauteur du panneau d'onglets à 100% (autoHeight ne semble pas fonctionner)ongletsStructure.setHeight("100%");// Onlget formulaire IDENTIFICATIONongletsStructure.add(creerOngletIdentification());// Onlget formulaire PERSONNELongletsStructure.add(creerOngletPersonnel());// Onlget formulaire CONSERVATIONongletsStructure.add(creerOngletConservation());// Onlget formulaire VALORISATIONongletsStructure.add(creerOngletValorisation());// Sélection de l'onglet par défaut//ongletsStructure(personnelOnglet);return ongletsStructure;}public void reinitialiserFormulaire() {if (mode.equals(StructureForm.MODE_MODIFIER)) {mediateur.afficherFormStructure(identification.getId());} else {mediateur.afficherFormStructure(null);}}public boolean soumettreFormulaire() {// Vérification de la validité des champs du formulaireboolean fomulaireValide = verifierFormulaire();if (fomulaireValide) {// Collecte des données du formulaireStructure structure = collecterStructureIdentification();StructureConservation conservation = collecterStructureConservation();StructureValorisation valorisation = collecterStructureValorisation();collecterStructurePersonnel();if (mode.equals(MODE_AJOUTER)) {// Ajout des informations sur la Structuremediateur.ajouterStructure(this, structure, conservation, valorisation);// L'ajout des relations StructureAPersonne se fait quand la structure a été ajoutée// Voir la méthode rafraichir().} else if (mode.equals(MODE_MODIFIER)) {// Modification des informations sur la Structureif (structure == null && conservation == null && valorisation == null) {InfoLogger.display("Modification d'une institution", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");} else {mediateur.modifierStructure(this, identification.getId(), structure, conservation, valorisation);}if (personnelModifie.size() == 0 && personnelAjoute.size() == 0 && personnelSupprime.size() == 0) {InfoLogger.display("Modification du personnel", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");} else {if (personnelModifie.size() != 0) {decompteRafraichissementPersonnel++;mediateur.modifierStructureAPersonne(this, personnelModifie);}// Ajout des relations StructureAPersonneif (personnelAjoute.size() != 0) {decompteRafraichissementPersonnel++;mediateur.ajouterStructureAPersonne(this, identification.getId(), personnelAjoute);}// Suppression des relations StructureAPersonneif (personnelSupprime.size() != 0) {decompteRafraichissementPersonnel++;mediateur.supprimerStructureAPersonne(this, personnelSupprime);}}}}return fomulaireValide;}public boolean verifierFormulaire() {ArrayList<String> messages = new ArrayList<String>();// Vérification des infos sur le nom de la structureif ( (identificationOnglet.getData("acces").equals(true) && nomStructureChp.getValue() == null) ||(identificationOnglet.getData("acces").equals(true) && nomStructureChp.getValue().equals("")) ||(identificationOnglet.getData("acces").equals(false) && identification.getNom().equals(""))) {messages.add("Veuillez indiquez un nom à l'institution.");}// Vérification des infos sur le projet de la structureif ( (identificationOnglet.getData("acces").equals(true) && projetsCombo.getCombo().getValue() == null) ||(identificationOnglet.getData("acces").equals(true) && projetsCombo.getCombo().getValue().equals("")) ||(identificationOnglet.getData("acces").equals(false) && identification.getIdProjet().equals(""))) {messages.add("Veuillez sélectionner un projet pour l'institution.");}// Vérification du Personnelif (personnelOnglet.getData("acces").equals(true)) {String personnelNumero = "";int nbrePersonne = personnelGrilleMagazin.getCount();for (int i = 0; i < nbrePersonne; i++) {StructureAPersonne personne = personnelGrilleMagazin.getAt(i);if (personne.getNom().equals("") || personne.getPrenom().equals("")) {personnelNumero += (i != 0 ? ", " : "")+(i+1);}}if (!personnelNumero.equals("")) {messages.add("Veuillez indiquez un prénom et un nom au personnel numéro : "+personnelNumero);}}//Vérification de la date de fondationString valeurDateFondation = dateFondationChp.getValue();if (!UtilString.isEmpty(valeurDateFondation) && (!valeurDateFondation.matches("\\d{2}/\\d{2}/\\d{4}") &&!valeurDateFondation.matches("\\d{4}"))) {messages.add("La date de fondation n'est pas au format jj/MM/AAAA ou AAAA");}// Affichage des messages d'alerteif (messages.size() != 0) {String[] a = {};a = messages.toArray(a);MessageBox.alert("Erreurs de saisies", UtilArray.implode(a, "\n\n"), null);return false;}return true;}private StructureValorisation collecterStructureValorisation() {StructureValorisation valorisationARetourner = null;if (valorisationOnglet.getData("acces").equals(true)) {// Création de l'objetStructureValorisation valorisationCollectee = (StructureValorisation) valorisation.cloner(new StructureValorisation());// ACTIONif (actionMarkRGrpChp.getValue() != null) {valorisationCollectee.setAction(actionMarkRGrpChp.getValue().getValueAttribute());}// ACTION INFOvalorisationCollectee.setActionInfo(creerChaineDenormalisee(actionTrukCacGrpChp.getValues()));valorisationCollectee.setActionInfo("AUTRE", actionAutreChp.getValue());// PUBLICATIONvalorisationCollectee.setPublication(publicationChp.getValue());// COLLECTION AUTREvalorisationCollectee.setCollectionAutre(creerChaineDenormalisee(autreCollectionTrukCacGrpChp.getValues()));valorisationCollectee.setCollectionAutre("AUTRE", autreCollectionAutreChp.getValue());// ACTION FUTUREif (futureActionMarkRGrpChp.getValue() != null) {valorisationCollectee.setActionFuture(futureActionMarkRGrpChp.getValue().getValueAttribute());}// ACTION FUTURE INFOvalorisationCollectee.setActionFutureInfo(futureActionChp.getValue());// RECHERCHEif (rechercheMarkRGrpChp.getValue() != null) {valorisationCollectee.setRecherche(rechercheMarkRGrpChp.getValue().getValueAttribute());// RECHERCHE PROVENANCEvalorisationCollectee.setRechercheProvenance(creerChaineDenormalisee(provenanceRechercheTrukCacGrpChp.getValues()));valorisationCollectee.setRechercheProvenance("AUTRE", provenanceRechercheAutreChp.getValue());// RECHERCHE TYPEvalorisationCollectee.setRechercheType(creerChaineDenormalisee(typeRechercheTrukCacGrpChp.getValues()));valorisationCollectee.setRechercheType("AUTRE", typeRechercheAutreChp.getValue());}// ACCÈS SANS MOTIFif (sansMotifAccesMarkRGrpChp.getValue() != null) {valorisationCollectee.setAccesSansMotif(sansMotifAccesMarkRGrpChp.getValue().getValueAttribute());}// ACCÈS SANS MOTIF INFOvalorisationCollectee.setAccesSansMotifInfo(sansMotifAccesChp.getValue());// VISITE AVEC MOTIFif (avecMotifAccesMarkRGrpChp.getValue() != null) {valorisationCollectee.setVisiteAvecMotif(avecMotifAccesMarkRGrpChp.getValue().getValueAttribute());}// VISITE AVEC MOTIF INFOvalorisationCollectee.setVisiteAvecMotifInfo(avecMotifAccesChp.getValue());// Retour de l'objetif (!valorisationCollectee.comparer(valorisation)) {valorisationARetourner = valorisation = valorisationCollectee;}}return valorisationARetourner;}private void peuplerStructureValorisation() {if (mode.equals(MODE_AJOUTER)) {// Indique que l'onglet a pu être modifié pour la méthode collecter...valorisationOnglet.setData("acces", true);// Initialisation de l'objet Structurevalorisation = new StructureValorisation();}if (mode.equals(MODE_MODIFIER) && valorisation != null && valorisationOnglet.getData("acces").equals(false)) {// ACTION ://TODO : check below:((Radio) actionMarkRGrpChp.get((valorisation.getAction().equals("1") ? 0 : 1))).setValue(true);// ACTION INFOpeuplerCasesACocher(valorisation.getActionInfo(), actionTrukCacGrpChp, actionAutreChp);// PUBLICATIONpublicationChp.setValue(valorisation.getPublication());// COLLECTION AUTREpeuplerCasesACocher(valorisation.getCollectionAutre(), autreCollectionTrukCacGrpChp, autreCollectionAutreChp);// ACTION FUTURE((Radio) futureActionMarkRGrpChp.get((valorisation.getActionFuture().equals("1") ? 0 : 1))).setValue(true);// ACTION FUTURE INFOfutureActionChp.setValue(valorisation.getActionFutureInfo());// RECHERCHE((Radio) rechercheMarkRGrpChp.get((valorisation.getRecherche().equals("1") ? 0 : 1))).setValue(true);// RECHERCHE PROVENANCEpeuplerCasesACocher(valorisation.getRechercheProvenance(), provenanceRechercheTrukCacGrpChp, provenanceRechercheAutreChp);// RECHERCHE TYPEpeuplerCasesACocher(valorisation.getRechercheType(), typeRechercheTrukCacGrpChp, typeRechercheAutreChp);// ACCÈS SANS MOTIF((Radio) sansMotifAccesMarkRGrpChp.get((valorisation.getAccesSansMotif().equals("1") ? 0 : 1))).setValue(true);// ACCÈS SANS MOTIF INFOsansMotifAccesChp.setValue(valorisation.getAccesSansMotifInfo());// VISITE AVEC MOTIF((Radio) avecMotifAccesMarkRGrpChp.get((valorisation.getVisiteAvecMotif().equals("1") ? 0 : 1))).setValue(true);// VISITE AVEC MOTIF INFOavecMotifAccesChp.setValue(valorisation.getVisiteAvecMotifInfo());// Indique que l'onglet a été rempli et a pu être modifié pour la méthode collecter...valorisationOnglet.setData("acces", true);}}private StructureConservation collecterStructureConservation() {StructureConservation conservationARetourner = null;if (conservationOnglet.getData("acces").equals(true)) {// Création de l'objetStructureConservation conservationCollectee = (StructureConservation) conservation.cloner(new StructureConservation());// FORMATIONif (formationMarkRGrpChp.getValue() != null) {conservationCollectee.setFormation(formationMarkRGrpChp.getValue().getValueAttribute());}// FORMATION INFOconservationCollectee.setFormationInfo(formationChp.getValue());// FORMATION INTERETif (interetFormationMarkRGrpChp.getValue() != null) {conservationCollectee.setFormationInteret(interetFormationMarkRGrpChp.getValue().getValueAttribute());}// STOCKAGE LOCALconservationCollectee.setStockageLocal(creerChaineDenormalisee(localStockageTrukCacGrpChp.getValues()));conservationCollectee.setStockageLocal("AUTRE", localStockageAutreChp.getValue());// STOCKAGE MEUBLEconservationCollectee.setStockageMeuble(creerChaineDenormalisee(meubleStockageTrukCacGrpChp.getValues()));conservationCollectee.setStockageMeuble("AUTRE", meubleStockageAutreChp.getValue());// STOCKAGE PAREMETREconservationCollectee.setStockageParametre(creerChaineDenormalisee(parametreStockageTrukCacGrpChp.getValues()));conservationCollectee.setStockageParametre("AUTRE", parametreStockageAutreChp.getValue());// COLLECTION COMMUNEif (collectionCommuneMarkRGrpChp.getValue() != null) {conservationCollectee.setCollectionCommune(collectionCommuneMarkRGrpChp.getValue().getValueAttribute());}// COLLECTION AUTREconservationCollectee.setCollectionAutre(creerChaineDenormalisee(collectionAutreTrukCacGrpChp.getValues()));conservationCollectee.setCollectionAutre("AUTRE", collectionAutreAutreChp.getValue());// ACCÈS CONTROLÉif (accesControleMarkRGrpChp.getValue() != null) {conservationCollectee.setAccesControle(accesControleMarkRGrpChp.getValue().getValueAttribute());}// RESTAURATIONif (restaurationMarkRGrpChp.getValue() != null) {conservationCollectee.setRestauration(restaurationMarkRGrpChp.getValue().getValueAttribute());}// RESTAURATION OPÉRATIONconservationCollectee.setRestaurationOperation(creerChaineDenormalisee(opRestauTrukCacGrpChp.getValues()));conservationCollectee.setRestaurationOperation("AUTRE", opRestauAutreChp.getValue());// MATERIEL CONSERVATIONif (materielConservationCeRGrpChp.getValue() != null) {conservationCollectee.setMaterielConservation(materielConservationCeRGrpChp.getValue().getValueAttribute());// MATERIEL AUTREconservationCollectee.setMaterielAutre(creerChaineDenormalisee(autreMaterielTrukCacGrpChp.getValues()));conservationCollectee.setMaterielAutre("AUTRE", autreMaterielAutreChp.getValue());}// TRAITEMENTif (traitementMarkRGrpChp.getValue() != null) {conservationCollectee.setTraitement(traitementMarkRGrpChp.getValue().getValueAttribute());}// TRAIEMENTSconservationCollectee.setTraitements(creerChaineDenormalisee(traitementTrukCacGrpChp.getValues()));conservationCollectee.setTraitements("AUTRE", traitementAutreChp.getValue());// ACQUISITION COLLECTIONif (collectionAcquisitionMarkRGrpChp.getValue() != null) {conservationCollectee.setAcquisitionCollection(collectionAcquisitionMarkRGrpChp.getValue().getValueAttribute());}// ACQUISITION ECHANTILLONif (echantillonAcquisitionMarkRGrpChp.getValue() != null) {conservationCollectee.setAcquisitionEchantillon(echantillonAcquisitionMarkRGrpChp.getValue().getValueAttribute());}// ACQUISITION TRAITEMENTif (traitementAcquisitionMarkRGrpChp.getValue() != null) {conservationCollectee.setAcquisitionTraitement(traitementAcquisitionMarkRGrpChp.getValue().getValueAttribute());}// ACQUISITION TRAITEMENT POISONconservationCollectee.setAcquisitionTraitementPoison(creerChaineDenormalisee(poisonTraitementTrukCacGrpChp.getValues()));conservationCollectee.setAcquisitionTraitementPoison("AUTRE", poisonTraitementAutreChp.getValue());// ACQUISITION TRAITEMENT INSECTEconservationCollectee.setAcquisitionTraitementInsecte(creerChaineDenormalisee(insecteTraitementTrukCacGrpChp.getValues()));conservationCollectee.setAcquisitionTraitementInsecte("AUTRE", insecteTraitementAutreChp.getValue());// Retour de l'objetif (!conservationCollectee.comparer(conservation)) {GWT.log("Collecte différent de Retour", null);conservationARetourner = conservation = conservationCollectee;}}return conservationARetourner;}private void peuplerStructureConservation() {if (mode.equals(MODE_AJOUTER)) {// Indique que l'onglet a pu être modifié pour la méthode collecter...conservationOnglet.setData("acces", true);// Initialisation de l'objet Structureconservation = new StructureConservation();}if (mode.equals(MODE_MODIFIER) && conservation != null && conservationOnglet.getData("acces").equals(false)) {// FORMATION// Bouton oui, à toujours l'index 0 donc on teste en fonction...((Radio) formationMarkRGrpChp.get((conservation.getFormation().equals("1") ? 0 : 1))).setValue(true);// FORMATION INFOformationChp.setValue(conservation.getFormationInfo());// FORMATION INTERET((Radio) interetFormationMarkRGrpChp.get((conservation.getFormationInteret().equals("1") ? 0 : 1))).setValue(true);// STOCKAGE LOCALpeuplerCasesACocher(conservation.getStockageLocal(), localStockageTrukCacGrpChp,localStockageAutreChp);// STOCKAGE MEUBLEpeuplerCasesACocher(conservation.getStockageMeuble(), meubleStockageTrukCacGrpChp, meubleStockageAutreChp);// STOCKAGE PAREMETREpeuplerCasesACocher(conservation.getStockageParametre(), parametreStockageTrukCacGrpChp, parametreStockageAutreChp);// COLLECTION COMMUNE((Radio) collectionCommuneMarkRGrpChp.get((conservation.getCollectionCommune().equals("1") ? 0 : 1))).setValue(true);// COLLECTION AUTREpeuplerCasesACocher(conservation.getCollectionAutre(), collectionAutreTrukCacGrpChp, collectionAutreAutreChp);// ACCÈS CONTROLÉ((Radio) accesControleMarkRGrpChp.get((conservation.getAccesControle().equals("1") ? 0 : 1))).setValue(true);// RESTAURATION((Radio) restaurationMarkRGrpChp.get((conservation.getRestauration().equals("1") ? 0 : 1))).setValue(true);// RESTAURATION OPÉRATIONpeuplerCasesACocher(conservation.getRestaurationOperation(), opRestauTrukCacGrpChp, opRestauAutreChp);// MATERIEL CONSERVATIONpeuplerBoutonsRadio(conservation.getMaterielConservation(), materielConservationCeRGrpChp);// MATERIEL AUTREpeuplerCasesACocher(conservation.getMaterielAutre(), autreMaterielTrukCacGrpChp, autreMaterielAutreChp);// TRAITEMENT((Radio) traitementMarkRGrpChp.get((conservation.getTraitement().equals("1") ? 0 : 1))).setValue(true);// TRAITEMENTSpeuplerCasesACocher(conservation.getTraitements(), traitementTrukCacGrpChp, traitementAutreChp);// ACQUISITION COLLECTION((Radio) collectionAcquisitionMarkRGrpChp.get((conservation.getAcquisitionCollection().equals("1") ? 0 : 1))).setValue(true);// ACQUISITION ECHANTILLON((Radio) echantillonAcquisitionMarkRGrpChp.get((conservation.getAcquisitionEchantillon().equals("1") ? 0 : 1))).setValue(true);// ACQUISITION TRAITEMENT((Radio) traitementAcquisitionMarkRGrpChp.get((conservation.getAcquisitionTraitement().equals("1") ? 0 : 1))).setValue(true);// ACQUISITION TRAITEMENT POISONpeuplerCasesACocher(conservation.getAcquisitionTraitementPoison(), poisonTraitementTrukCacGrpChp, poisonTraitementAutreChp);// ACQUISITION TRAITEMENT INSECTEpeuplerCasesACocher(conservation.getAcquisitionTraitementInsecte(), insecteTraitementTrukCacGrpChp, insecteTraitementAutreChp);// Indique que l'onglet a été rempli et a pu être modifié pour la méthode collecter...conservationOnglet.setData("acces", true);}}private Structure collecterStructureIdentification() {Structure structureARetourner = null;if (identificationOnglet.getData("acces").equals(true)) {Structure structureCollectee = (Structure) identification.cloner(new Structure());structureCollectee.setId(idStructureChp.getValue());structureCollectee.setNom(nomStructureChp.getValue());// Récupération de l'identifiant du projetif (projetsCombo.getCombo().getValue() != null) {structureCollectee.setIdProjet(new Projet(projetsCombo.getValeur()).getId());}// Récupération de l'acronyme (= identifiant alternatif)structureCollectee.setIdAlternatif(null);if (comboAcronyme.getValue() != null) {String typeAcronyme = comboAcronyme.getValue().getAbr();if (typeAcronyme == "IH") {structureCollectee.setIdAlternatif(typeAcronyme+"##"+ihChp.getValue());} else if (typeAcronyme == "MNHN") {structureCollectee.setIdAlternatif(typeAcronyme+"##"+mnhnChp.getValue());}}// Récupération statut de la structurestructureCollectee.setTypePublic(null);structureCollectee.setTypePrive(null);if (comboTypeStructure.getValue() != null) {String typeStructure = comboTypeStructure.getValue().getAbr();if (typeStructure == "stpu" && comboLstpu.getValue() != null) {structureCollectee.setTypePublic(comboLstpu.getValue().getId());} else if (typeStructure == "stpr" && comboLstpr.getValue() != null) {structureCollectee.setTypePrive(comboLstpr.getValue().getId());}}String valeurDateFondation = dateFondationChp.getValue();if (!UtilString.isEmpty(valeurDateFondation)) {if (valeurDateFondation.matches("\\d{2}/\\d{2}/\\d{4}")) {Date dateFondation = DateTimeFormat.getFormat("dd/MM/yyyy").parse(valeurDateFondation);structureCollectee.setDateFondation(dateFondation);} else if (valeurDateFondation.matches("\\d{4}")) {structureCollectee.setDateFondation(valeurDateFondation + "-00-00");}}structureCollectee.setDescription(descriptionChp.getValue());structureCollectee.setConditionAcces(conditionAccesChp.getValue());structureCollectee.setConditionUsage(conditionUsageChp.getValue());structureCollectee.setAdresse(adrChp.getValue());structureCollectee.setAdresseComplement(adrComplementChp.getValue());structureCollectee.setCodePostal(cpChp.getValue());structureCollectee.setVille(villeChp.getValue());String strRegion = "";Valeur valeurRegion = comboRegion.getValue();if (valeurRegion == null) {strRegion = "AUTRE##" + comboRegion.getRawValue();} else {strRegion = valeurRegion.getId();}structureCollectee.setRegion(strRegion);structureCollectee.setPays(null);if (comboPays.getCombo().getValue() != null) {structureCollectee.setPays(new Valeur(comboPays.getValeur()).getId());} else if (comboPays.getCombo().getRawValue() != "") {structureCollectee.setPays(comboPays.getCombo().getRawValue());}structureCollectee.setLatitude(latitudeChp.getValue());structureCollectee.setLongitude(longitudeChp.getValue());structureCollectee.setTelephoneFixe(telChp.getValue());structureCollectee.setFax(faxChp.getValue());structureCollectee.setCourriel(emailChp.getValue());structureCollectee.setUrl(Structure.URL_SITE, urlChp.getValue());if (nbreTotalPersonneStructureChp.getValue() != null) {structureCollectee.setNbrePersonne(nbreTotalPersonneStructureChp.getValue().intValue());}if (!structureCollectee.comparer(identification)) {structureARetourner = identification = structureCollectee;}}return structureARetourner;}private void peuplerStructureIdentification() {if (mode.equals(MODE_AJOUTER)) {// Indique que l'ongleta pu être modifié pour la méthode collecter...identificationOnglet.setData("acces", true);// Initialisation de l'objet Structureidentification = new Structure();// Indication du projet sélectionné par défautString projetCourantId = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getProjetId();if (projetCourantId != null && !projetCourantId.equals("0")) {projetsCombo.getCombo().setValue(projetsCombo.getStore().findModel("cpr_id_projet", projetCourantId));}}if (mode.equals(MODE_MODIFIER) && identification != null && identificationOnglet.getData("acces").equals(false)) {idStructureChp.setValue(identification.getId());nomStructureChp.setValue(identification.getNom());if (!identification.getIdProjet().equals("0")) {projetsCombo.getCombo().setValue(projetsCombo.getStore().findModel("cpr_id_projet", identification.getIdProjet()));}if (!identification.getIdAlternatif().isEmpty()) {String[] acronyme = identification.getIdAlternatif().split("##");//#436 : Ne pas afficher "null"if (UtilString.isEmpty(acronyme[1]) || acronyme[1].equals("null")) {acronyme[1] = "";}if (acronyme[0].matches("^IH$")) {comboAcronyme.setValue(InterneValeurListe.getTypeAcronymeIH());ihChp.setValue(acronyme[1]);} else if (acronyme[0].matches("^MNHN$")) {comboAcronyme.setValue(InterneValeurListe.getTypeAcronymeMNHN());mnhnChp.setValue(acronyme[1]);}}if (!identification.getTypePrive().isEmpty()) {if (identification.getTypePrive().matches("^[0-9]+$")) {comboTypeStructure.setValue(InterneValeurListe.getTypePrivee());comboLstpr.setValue(comboLstpr.getStore().findModel("id_valeur", identification.getTypePrive()));}} else if (!identification.getTypePublic().isEmpty()) {if (identification.getTypePublic().matches("^[0-9]+$")) {comboTypeStructure.setValue(InterneValeurListe.getTypePublique());comboLstpu.setValue(comboLstpu.getStore().findModel("id_valeur", identification.getTypePublic()));}}String dateFondation = identification.getAnneeOuDateFondation();if (!dateFondation.equals("")) {if (dateFondation.endsWith("00-00")) {dateFondationChp.setValue(dateFondation.substring(0, 4));} else {Date date = DateTimeFormat.getFormat("yyyy-MM-dd").parse(dateFondation);dateFondationChp.setValue(DateTimeFormat.getFormat("dd/MM/yyyy").format(date));}}descriptionChp.setValue(identification.getDescription());conditionAccesChp.setValue(identification.getConditionAcces());conditionUsageChp.setValue(identification.getConditionUsage());adrChp.setValue(identification.getAdresse());adrComplementChp.setValue(identification.getAdresseComplement());cpChp.setValue(identification.getCodePostal());villeChp.setValue(identification.getVille());mettreAJourRegion();//(identification.getRegion());if (identification.getPays().matches("^[0-9]+$")) {comboPays.getCombo().setValue(comboPays.getStore().findModel("cmlv_id_valeur", identification.getPays()));} else {comboPays.getCombo().setRawValue(identification.getPays());}latitudeChp.setValue(identification.getLatitude());longitudeChp.setValue(identification.getLongitude());telChp.setValue(identification.getTelephoneFixe());faxChp.setValue(identification.getFax());emailChp.setValue(identification.getCourriel());urlChp.setValue(identification.getUrl("WEB"));nbreTotalPersonneStructureChp.setValue(identification.getNbrePersonne());// Indique que l'onglet a été rempli et a pu être modifié pour la méthode collecter...identificationOnglet.setData("acces", true);}}private TabItem creerOngletValorisation() {valorisationOnglet = creerOnglet("Valorisation", "valorisation");valorisationOnglet.setLayout(creerFormLayout(650, LabelAlign.TOP));Listener<ComponentEvent> ecouteurSelection = new Listener<ComponentEvent>() {public void handleEvent(ComponentEvent be) {peuplerStructureValorisation();valorisationOnglet.layout();}};valorisationOnglet.addListener(Events.Select, ecouteurSelection);actionMarkRGrpChp = creerChoixUniqueRadioGroupe("action_mark", "ouiNon");actionMarkRGrpChp.setFieldLabel("Avez-vous réalisé des actions de valorisation de vos collections botaniques ou avez-vous été sollicités pour la valorisation de ces collections ?");valorisationOnglet.add(actionMarkRGrpChp);actionTrukCp = creerChoixMultipleCp();actionTrukCp.hide();actionTrukCacGrpChp = new CheckBoxGroup();actionTrukCacGrpChp.setFieldLabel("Si oui, lesquelles ?");valorisationOnglet.add(actionTrukCp);mediateur.obtenirListeValeurEtRafraichir(this, "actionValorisation");publicationChp = new TextArea();publicationChp.setFieldLabel("Quelques titres des ouvrages, articles scientifiques, ...");valorisationOnglet.add(publicationChp, new FormData(550, 0));autreCollectionTrukCp = creerChoixMultipleCp();autreCollectionTrukCacGrpChp = new CheckBoxGroup();autreCollectionTrukCacGrpChp.setFieldLabel("L'organisme dispose-t-il d'autres collections (permettant une valorisation pluridisciplinaire) ?");valorisationOnglet.add(autreCollectionTrukCp);mediateur.obtenirListeValeurEtRafraichir(this, "autreCollection");futureActionMarkRGrpChp = creerChoixUniqueRadioGroupe("future_action_mark", "ouiNon");futureActionMarkRGrpChp.setFieldLabel("Envisagez vous des actions de valorisation dans le cadre de votre politique culturelle ?");valorisationOnglet.add(futureActionMarkRGrpChp);futureActionChp = new TextArea();futureActionChp.setFieldLabel("Si oui, lesquelles ?");futureActionChp.hide();futureActionChp.addListener(Events.Hide, new Listener<BaseEvent>() {public void handleEvent(BaseEvent be) {((TextArea) be.getSource()).setValue("");}});valorisationOnglet.add(futureActionChp, new FormData(550, 0));rechercheMarkRGrpChp = creerChoixUniqueRadioGroupe("recherche_mark", "ouiNon");rechercheMarkRGrpChp.setFieldLabel("Vos collections botaniques sont-elles utilisées pour des recherches scientifiques ?");valorisationOnglet.add(rechercheMarkRGrpChp);provenanceRechercheTrukCp = creerChoixMultipleCp();provenanceRechercheTrukCp.hide();provenanceRechercheTrukCacGrpChp = new CheckBoxGroup();provenanceRechercheTrukCacGrpChp.setFieldLabel("Si oui, par des chercheurs (professionnels ou amateurs) de quelle provenance ?");valorisationOnglet.add(provenanceRechercheTrukCp);mediateur.obtenirListeValeurEtRafraichir(this, "continentEtFr");typeRechercheTrukCp = creerChoixMultipleCp();typeRechercheTrukCp.hide();typeRechercheTrukCacGrpChp = new CheckBoxGroup();typeRechercheTrukCacGrpChp.setFieldLabel("Et pour quelles recherches ?");valorisationOnglet.add(typeRechercheTrukCp);mediateur.obtenirListeValeurEtRafraichir(this, "typeRecherche");sansMotifAccesMarkRGrpChp = creerChoixUniqueRadioGroupe("sans_motif_acces_mark", "ouiNon");sansMotifAccesMarkRGrpChp.setFieldLabel("Peut-on consulter vos collections botaniques sans motif de recherches scientifiques ?");valorisationOnglet.add(sansMotifAccesMarkRGrpChp);valorisationOnglet.add(sansMotifAccesChp = new TextArea(), new FormData(550, 0));sansMotifAccesChp.hide();sansMotifAccesChp.addListener(Events.Hide, new Listener<BaseEvent>() {public void handleEvent(BaseEvent be) {((TextArea) be.getSource()).setValue("");}});sansMotifAccesChp.setFieldLabel("Si oui, quelles démarches doit-on faire pour les consulter ?");avecMotifAccesMarkRGrpChp = creerChoixUniqueRadioGroupe("avec_motif_acces_mark", "ouiNon");avecMotifAccesMarkRGrpChp.setFieldLabel("Peut-on visiter vos collections botaniques avec des objectifs de recherches scientifiques ?");valorisationOnglet.add(avecMotifAccesMarkRGrpChp);valorisationOnglet.add(avecMotifAccesChp = new TextArea(), new FormData(550, 0));avecMotifAccesChp.hide();avecMotifAccesChp.addListener(Events.Hide, new Listener<BaseEvent>() {public void handleEvent(BaseEvent be) {((TextArea) be.getSource()).setValue("");}});avecMotifAccesChp.setFieldLabel("Si oui, quelles démarches doit-on faire pour les visiter ?");return valorisationOnglet;}private TabItem creerOngletConservation() {conservationOnglet = creerOnglet("Conservation", "conservation");conservationOnglet.setLayout(creerFormLayout(650, LabelAlign.TOP));Listener<ComponentEvent> ecouteurSelection = new Listener<ComponentEvent>() {public void handleEvent(ComponentEvent be) {peuplerStructureConservation();conservationOnglet.layout();}};conservationOnglet.addListener(Events.Select, ecouteurSelection);formationMarkRGrpChp = creerChoixUniqueRadioGroupe("formation_mark", "ouiNon");formationMarkRGrpChp.setFieldLabel("Le personnel s'occupant des collections a-t-il suivi des formations en conservations ?");conservationOnglet.add(formationMarkRGrpChp);formationChp = new TextArea();formationChp.hide();formationChp.addListener(Events.Hide, new Listener<BaseEvent>() {public void handleEvent(BaseEvent be) {((TextArea) be.getSource()).setValue("");}});formationChp.setFieldLabel("Si oui, lesquelles ?");conservationOnglet.add(formationChp);interetFormationMarkRGrpChp = creerChoixUniqueRadioGroupe("interet_formation_mark", "ouiNon");interetFormationMarkRGrpChp.setFieldLabel("Seriez vous intéressé par une formation à la conservation et à la restauration d'herbier ?");conservationOnglet.add(interetFormationMarkRGrpChp);localStockageTrukCacGrpChp = new CheckBoxGroup();localStockageTrukCacGrpChp.setFieldLabel("Avez vous des locaux spécifiques de stockage des collections botaniques ?");localStockageTrukCp = creerChoixMultipleCp();conservationOnglet.add(localStockageTrukCp);mediateur.obtenirListeValeurEtRafraichir(this, "localStockage");meubleStockageTrukCp = creerChoixMultipleCp();meubleStockageTrukCacGrpChp = new CheckBoxGroup();meubleStockageTrukCacGrpChp.setFieldLabel("Avez vous des meubles spécifiques au stockage des collections botaniques ?");conservationOnglet.add(meubleStockageTrukCp);mediateur.obtenirListeValeurEtRafraichir(this, "meubleStockage");parametreStockageTrukCp = creerChoixMultipleCp();parametreStockageTrukCacGrpChp = new CheckBoxGroup();parametreStockageTrukCacGrpChp.setFieldLabel("Quels paramètres maîtrisez vous ?");conservationOnglet.add(parametreStockageTrukCp);mediateur.obtenirListeValeurEtRafraichir(this, "parametreStockage");collectionCommuneMarkRGrpChp = creerChoixUniqueRadioGroupe("collection_commune_mark", "ouiNon");collectionCommuneMarkRGrpChp.setFieldLabel("Les collections botaniques sont-elles conservées avec d'autres collections dans les mêmes locaux (problème de conservation en commun) ?");conservationOnglet.add(collectionCommuneMarkRGrpChp);collectionAutreTrukCp = creerChoixMultipleCp();collectionAutreTrukCacGrpChp = new CheckBoxGroup();collectionAutreTrukCacGrpChp.setFieldLabel("Si oui, lesquelles ?");collectionAutreTrukCp.hide();conservationOnglet.add(collectionAutreTrukCp);mediateur.obtenirListeValeurEtRafraichir(this, "autreCollection");accesControleMarkRGrpChp = creerChoixUniqueRadioGroupe("mark_acces_controle", "ouiNon");accesControleMarkRGrpChp.setFieldLabel("L'accès à vos collections botanique est-il contrôlé (ex. : manipulation réservées à des personnes compétentes) ?");conservationOnglet.add(accesControleMarkRGrpChp);restaurationMarkRGrpChp = creerChoixUniqueRadioGroupe("restauration_mark", "ouiNon");restaurationMarkRGrpChp.setFieldLabel("Effectuez vous des opérations de restauration ou de remise en état de vos collections botaniques ?");conservationOnglet.add(restaurationMarkRGrpChp);opRestauTrukCp = creerChoixMultipleCp();opRestauTrukCacGrpChp = new CheckBoxGroup();opRestauTrukCacGrpChp.setFieldLabel("Si oui, lesquelles ?");opRestauTrukCp.hide();conservationOnglet.add(opRestauTrukCp);mediateur.obtenirListeValeurEtRafraichir(this, "opRestau");// Création d'un ContentPanel vide et du groupe de bouton radio// Le groupe de bouton radio recevra les boutons au moment de la réception des données (rafraichir()) et ser à ce moment là ajouter au ContenetPanelmaterielConservationCp = creerChoixMultipleCp();conservationOnglet.add(materielConservationCp);materielConservationCeRGrpChp = creerChoixUniqueRadioGroupe("materiel_conservation_ce", "onep");materielConservationCeRGrpChp.setFieldLabel("Utilisez vous du matériel de conservation ?");materielConservationCeRGrpChp.setToolTip(new ToolTipConfig("Matériel de conservation", "matériel spécialisé pour la conservation des archives ou du patrimoine fragile. Ce matériel possède des propriétés mécaniques et chimiques qui font qu'il résiste dans le temps et que sa dégradation n'entraîne pas de dommages sur le matériel qu'il aide à conserver. Exemples : papier neutre, papier gommé, etc..."));mediateur.obtenirListeValeurEtRafraichir(this, "onep");autreMaterielTrukCp = creerChoixMultipleCp();autreMaterielTrukCacGrpChp = new CheckBoxGroup();autreMaterielTrukCacGrpChp.setFieldLabel("Si non, qu'utilisez vous comme matériel ?");autreMaterielTrukCp.hide();conservationOnglet.add(autreMaterielTrukCp);mediateur.obtenirListeValeurEtRafraichir(this, "autreMateriel");traitementMarkRGrpChp = creerChoixUniqueRadioGroupe("traitement_mark", "ouiNon");traitementMarkRGrpChp.setFieldLabel("Réalisez vous actuellement des traitements globaux contre les insectes ?");conservationOnglet.add(traitementMarkRGrpChp);traitementTrukCp = creerChoixMultipleCp();traitementTrukCp.hide();traitementTrukCacGrpChp = new CheckBoxGroup();traitementTrukCacGrpChp.setFieldLabel("Si oui, lesquels ?");conservationOnglet.add(traitementTrukCp);mediateur.obtenirListeValeurEtRafraichir(this, "insecteTraitement");collectionAcquisitionMarkRGrpChp = creerChoixUniqueRadioGroupe("collection_acquisition_mark", "ouiNon");collectionAcquisitionMarkRGrpChp.setFieldLabel("Actuellement, vos collections botaniques s'accroissent-elles de nouvelles acquisitions ?");conservationOnglet.add(collectionAcquisitionMarkRGrpChp);echantillonAcquisitionMarkRGrpChp = creerChoixUniqueRadioGroupe("echantillon_acquisition_mark", "ouiNon");echantillonAcquisitionMarkRGrpChp.setFieldLabel("Actuellement, mettez vous en herbier de nouveaux échantillons ?");conservationOnglet.add(echantillonAcquisitionMarkRGrpChp);traitementAcquisitionMarkRGrpChp = creerChoixUniqueRadioGroupe("traitement_acquisition_mark", "ouiNon");traitementAcquisitionMarkRGrpChp.hide();traitementAcquisitionMarkRGrpChp.setFieldLabel("Si oui, faites-vous un traitement contre les insectes avant l'intégration dans vos collections ?");conservationOnglet.add(traitementAcquisitionMarkRGrpChp);traitementAcquisitionMarkLabel = new LabelField();traitementAcquisitionMarkLabel.hide();traitementAcquisitionMarkLabel.setFieldLabel("Si oui, lesquels ?");conservationOnglet.add(traitementAcquisitionMarkLabel);poisonTraitementTrukCp = creerChoixMultipleCp();poisonTraitementTrukCp.hide();poisonTraitementTrukCacGrpChp = new CheckBoxGroup();poisonTraitementTrukCacGrpChp.setFieldLabel("Empoisonnement");poisonTraitementTrukCacGrpChp.setLabelStyle("font-weight:normal;text-decoration:underline;");poisonTraitementTrukCacGrpChp.setLabelSeparator("");conservationOnglet.add(poisonTraitementTrukCp);mediateur.obtenirListeValeurEtRafraichir(this, "poisonTraitement");insecteTraitementTrukCp = creerChoixMultipleCp();insecteTraitementTrukCp.hide();insecteTraitementTrukCacGrpChp = new CheckBoxGroup();insecteTraitementTrukCacGrpChp.setLabelStyle("font-weight:normal;text-decoration:underline;");insecteTraitementTrukCacGrpChp.setLabelSeparator("");insecteTraitementTrukCacGrpChp.setFieldLabel("Désinsectisation");conservationOnglet.add(insecteTraitementTrukCp);mediateur.obtenirListeValeurEtRafraichir(this, "insecteTraitement");conservationOnglet.add(new Html("<br />"));return conservationOnglet;}private void collecterStructurePersonnel() {if (personnelOnglet.getData("acces").equals(true)) {personnelGrilleMagazin.commitChanges();int nbrePersonne = personnelGrilleMagazin.getCount();for (int i = 0; i < nbrePersonne; i++) {StructureAPersonne personne = personnelGrilleMagazin.getAt(i);// Seules les lignes ajoutées ou modifiées sont prises en compte.Record record = personnelGrilleMagazin.getRecord(personne);if (personnelGrilleMagazin.getModifiedRecords().contains(record) == true|| (personne.get("etat") != null && (personne.get("etat").equals(StructureAPersonne.ETAT_AJOUTE) || personne.get("etat").equals(StructureAPersonne.ETAT_MODIFIE)) )) {// Gestion de l'id de la structureif (mode.equals("MODIF")) {personne.setIdStructure(identification.getId());}// Récupération de l'id du projet de la structure qui servira aussi pour les Personnes crées dans ce formulaireif (personne.getIdPersonne().equals("") && projetsCombo.getCombo().getValue() != null) {personne.setIdProjetPersonne(new Projet(projetsCombo.getValeur()).getId());}// Gestion de la fonctionString fonction = personne.get("fonction");if (fonction != null && !fonction.equals("")) {Valeur valeurRecherche = fonctionsCombo.getStore().findModel("nom", fonction);if (valeurRecherche != null) {personne.setFonction(valeurRecherche.getId());} else {personne.setFonction("AUTRE", fonction);}} else {personne.setFonction("");}// Gestion du nom completString nomComplet = personne.getPrenom()+" "+personne.getNom();personne.setNomComplet(nomComplet);// Gestion de la notion de "contact"personne.setContact(false);if (personne.get("contact").equals(true)) {personne.setContact(true);}// Gestion du statutString statut = personne.get("statut");if (statut != null && !statut.equals("")) {Valeur valeurRecherche = comboLiStatut.getStore().findModel("nom", statut);if (valeurRecherche != null) {personne.setStatut(valeurRecherche.getId());} else {personne.setStatut("AUTRE", statut);}} else {personne.setStatut("");}// Gestion du temps de travailpersonne.setBotaTravailHebdoTps(personne.get("travail").toString());// Gestion du téléphoneString telephoneFixe = personne.get("tel_fix");personne.setTelephoneFixe(telephoneFixe);// Gestion du faxString fax = personne.get("tel_fax");personne.setFax(fax);// Gestion du courrielString courriel = personne.get("courriel");personne.setCourriel(courriel);// Gestion de la spécialitéString specialite = personne.get("specialite");personne.setSpecialite(specialite);// On met à faux le décèspersonne.setDeces(Personne.ETRE_VIVANT);// Ajout de la personne dans la liste correspondant à son état (ajouté ou modifié)if (personne.get("etat") != null && personne.get("etat").equals(StructureAPersonne.ETAT_AJOUTE)) { // Une personne ajoutéepersonnelAjoute.put(""+i, personne);} else {// Une personne modifiéepersonnelModifie.put(personne.getId(), personne);}} else {GWT.log("Personne non modifiées : "+personne.getPrenom()+" "+personne.getNom(), null);}}}}private void peuplerStructurePersonnel() {if (mode.equals(MODE_MODIFIER) && personnel != null) {ArrayList<StructureAPersonne> personnes = new ArrayList<StructureAPersonne>();for (Iterator<String> it = personnel.keySet().iterator(); it.hasNext();) {String index = it.next();// Gestion de la fonctionif (fonctionsMagazin != null && !((String) personnel.get(index).getFonction()).startsWith("AUTRE##")) {if (fonctionsMagazin.findModel("id_valeur", personnel.get(index).getFonction()) != null) {personnel.get(index).set("fonction", fonctionsMagazin.findModel("id_valeur", personnel.get(index).getFonction()).getNom());}} else {personnel.get(index).set("fonction", personnel.get(index).getFonction().replaceFirst("AUTRE##", ""));}// Gestion de la notion de "contact"personnel.get(index).set("contact", (personnel.get(index).getContact().equals("1") ? true : false));// Gestion du statutif (magazinLiStatut != null && ((String) personnel.get(index).getStatut()).matches("^[0-9]+$")) {personnel.get(index).set("statut", magazinLiStatut.findModel("id_valeur", personnel.get(index).getStatut()).getNom());} else {personnel.get(index).set("statut", personnel.get(index).getStatut().replaceFirst("AUTRE##", ""));}// Gestion de la specialiteif (((String) personnel.get(index).getSpecialite()).matches("^[0-9]+$")) {// Author : Cyprien// TODO// Ici faire un combobox ?// ...} else {personnel.get(index).set("specialite", personnel.get(index).getSpecialite().replaceFirst("AUTRE##", ""));}// Gestion du temps de travailString tps = personnel.get(index).getBotaTravailHebdoTps();personnel.get(index).set("travail", (tps.matches("^[0-9]+$") ? Integer.parseInt(tps) : 0));personnes.add(personnel.get(index));}personnelGrilleMagazin.removeAll();personnelGrilleMagazin.add(personnes);// Nous vidons la variable personnel une fois qu'elle a remplie la grillepersonnel = null;}}private TabItem creerOngletPersonnel() {// Création des objets contenant les manipulations de la grillepersonnelModifie = new StructureAPersonneListe();personnelAjoute = new StructureAPersonneListe();personnelSupprime = new StructureAPersonneListe();personnelOnglet = creerOnglet("Personnel", "personnel");personnelOnglet.setLayout(creerFormLayout(400, LabelAlign.LEFT));personnelOnglet.setStyleAttribute("padding", "0");personnelOnglet.addListener(Events.Select, new Listener<ComponentEvent>() {public void handleEvent(ComponentEvent be) {// Indique que l'onglet a été rempli et a pu être modifié pour la méthode collecter...personnelOnglet.setData("acces", true);// Rafraichissement du contenu de la grille du personnelif (mode.equals(MODE_AJOUTER)) {rafraichirPersonnel();}}});ContentPanel cp = new ContentPanel();cp.setHeading("Personnes travaillant sur les collections");cp.setIcon(Images.ICONES.table());cp.setScrollMode(Scroll.AUTO);cp.setLayout(new FitLayout());//cp.setWidth(1250);//cp.setHeight("100%");cp.setFrame(true);personnelGrilleMagazin = new ListStore<StructureAPersonne>();personnelGrilleMagazin.setMonitorChanges(true);personnelGrilleMagazin.addListener(Store.Add, new Listener<StoreEvent<StructureAPersonne>>() {public void handleEvent(StoreEvent<StructureAPersonne> ce) {// Activation du bouton supprimer si la grille contient un élémentif (grillePersonnel.getStore().getCount() > 0) {supprimerPersonnelBtn.enable();}}});RowNumberer r = new RowNumberer();List<ColumnConfig> configs = new ArrayList<ColumnConfig>();GridSelectionModel<StructureAPersonne> sm = new GridSelectionModel<StructureAPersonne>();configs.add(r);ColumnConfig column = new ColumnConfig("fonction", "Fonction", 150);fonctionsMagazin = new ListStore<Valeur>();fonctionsCombo = new ComboBox<Valeur>();fonctionsCombo.setTriggerAction(TriggerAction.ALL);fonctionsCombo.setEditable(true);fonctionsCombo.setDisplayField("nom");fonctionsCombo.setStore(fonctionsMagazin);mediateur.obtenirListeValeurEtRafraichir(this, "fonction");fonctionEditor = new CellEditor(fonctionsCombo) {@Overridepublic Object preProcessValue(Object valeur) {Valeur retour = null;if (valeur != null) {String chaineTransmise = (String) valeur;if (fonctionsMagazin.getCount() == 0 && fonctionsListe != null) {fonctionsMagazin.add(fonctionsListe);}if (fonctionsMagazin.findModel("id_valeur", chaineTransmise) != null) {retour = fonctionsMagazin.findModel("id_valeur", chaineTransmise);} else if (fonctionsMagazin.findModel("nom", chaineTransmise) != null) {retour = fonctionsMagazin.findModel("nom", chaineTransmise);} else {retour = new Valeur("", chaineTransmise, "", "");}}return retour;}@Overridepublic Object postProcessValue(Object valeur) {String retour = "";Valeur fonctionTrouvee = null;if (valeur == null) {String valeurBrute = this.getField().getRawValue();if (fonctionsMagazin.getCount() == 0 && fonctionsListe != null) {fonctionsMagazin.add(fonctionsListe);}if (valeurBrute.matches("^[0-9]+$") && fonctionsMagazin.findModel("id_valeur", valeurBrute) != null) {fonctionTrouvee = fonctionsMagazin.findModel("id_valeur", valeurBrute);} else {retour = valeurBrute;}} else if (valeur instanceof Valeur) {fonctionTrouvee = (Valeur) valeur;}if (fonctionTrouvee != null) {retour = fonctionTrouvee.getNom();}return retour;}};column.setEditor(fonctionEditor);configs.add(column);column = new ColumnConfig("prenom", "Prénom", 100);TextField<String> prenomChp = new TextField<String>();prenomChp.setAllowBlank(false);prenomChp.getMessages().setBlankText("Ce champ est obligatoire.");prenomChp.setAutoValidate(true);prenomChp.addStyleName(ComposantClass.OBLIGATOIRE);prenomChp.addListener(Events.Valid, creerEcouteurChampObligatoire());column.setEditor(new CellEditor(prenomChp));configs.add(column);column = new ColumnConfig("nom", "Nom", 100);TextField<String> nomChp = new TextField<String>();nomChp.setAllowBlank(false);nomChp.getMessages().setBlankText("Ce champ est obligatoire.");nomChp.setAutoValidate(true);nomChp.addStyleName(ComposantClass.OBLIGATOIRE);nomChp.addListener(Events.Valid, creerEcouteurChampObligatoire());column.setEditor(new CellEditor(nomChp));configs.add(column);column = new ColumnConfig("tel_fix", "Téléphone fixe", 100);TextField<String> telChp = new TextField<String>();column.setEditor(new CellEditor(telChp));configs.add(column);column = new ColumnConfig("tel_fax", "Fax", 100);TextField<String> faxChp = new TextField<String>();column.setEditor(new CellEditor(faxChp));configs.add(column);column = new ColumnConfig("courriel", "Courriel principal", 200);TextField<String> emailChp = new TextField<String>();column.setEditor(new CellEditor(emailChp));configs.add(column);magazinLiStatut = new ListStore<Valeur>();magazinLiStatut.add(new ArrayList<Valeur>());comboLiStatut = new ComboBox<Valeur>();comboLiStatut.setTriggerAction(TriggerAction.ALL);comboLiStatut.setEditable(false);comboLiStatut.disableTextSelection(true);comboLiStatut.setDisplayField("nom");comboLiStatut.setStore(magazinLiStatut);mediateur.obtenirListeValeurEtRafraichir(this, "statut");CellEditor statutEditor = new CellEditor(comboLiStatut) {@Overridepublic Object preProcessValue(Object value) {if (value == null) {return value;}return comboLiStatut.getStore().findModel("nom", (String) value);}@Overridepublic Object postProcessValue(Object value) {if (value == null) {return value;}return ((Valeur) value).get("nom");}};column = new ColumnConfig("statut", "Statut", 100);column.setEditor(statutEditor);configs.add(column);column = new ColumnConfig("travail", "Travail hebdo (%)", 100);column.setNumberFormat(NumberFormat.getFormat("##"));NumberField tpsWChp = new NumberField();tpsWChp.setFormat(NumberFormat.getFormat("##"));tpsWChp.setToolTip("Ce champ doit contenir un nombre");column.setEditor(new CellEditor(tpsWChp));configs.add(column);column = new ColumnConfig("specialite", "Spécialité principale", 150);TextField<String> speChp = new TextField<String>();column.setEditor(new CellEditor(speChp));configs.add(column);CheckColumnConfig checkColumn = new CheckColumnConfig("contact", "Contact ?", 60);configs.add(checkColumn);ToolBar toolBar = new ToolBar();Button ajouterPersonnelBtn = new Button("Ajouter");ajouterPersonnelBtn.setIcon(Images.ICONES.vcardAjouter());ajouterPersonnelBtn.addSelectionListener(new SelectionListener<ButtonEvent>() {@Overridepublic void componentSelected(ButtonEvent ce) {StructureAPersonne membreDuPersonnel = new StructureAPersonne("", StructureAPersonne.ROLE_EQUIPE, StructureAPersonne.ETAT_AJOUTE);ajouterMembreAGrillePersonnel(membreDuPersonnel);}});toolBar.add(ajouterPersonnelBtn);toolBar.add(new SeparatorToolItem());supprimerPersonnelBtn = new Button("Supprimer");supprimerPersonnelBtn.setIcon(Images.ICONES.vcardSupprimer());supprimerPersonnelBtn.addSelectionListener(new SelectionListener<ButtonEvent>() {@Overridepublic void componentSelected(ButtonEvent ce) {StructureAPersonne personne = grillePersonnel.getSelectionModel().getSelectedItem();if (personne != null) {// Ajout de la personne supprimée à la listeif (personne.getIdPersonne() != null && !personne.getIdPersonne().equals("")) {personnelSupprime.put(personne.getId(), personne);}// Suppression de l'enregistrement de la grillegrillePersonnel.getStore().remove(personne);// Désactivation du bouton supprimer si la grille contient plus d'élémentif (grillePersonnel.getStore().getCount() == 0) {//TODO : check : Item -> componentce.getComponent().disable();}}}});toolBar.add(supprimerPersonnelBtn);toolBar.add(new SeparatorToolItem());Button rafraichirPersonnelBtn = new Button("Rafraichir");rafraichirPersonnelBtn.setIcon(Images.ICONES.rafraichir());rafraichirPersonnelBtn.addSelectionListener(new SelectionListener<ButtonEvent>() {@Overridepublic void componentSelected(ButtonEvent ce) {rafraichirPersonnel();}});toolBar.add(rafraichirPersonnelBtn);toolBar.add(new SeparatorToolItem());personneExistanteMagazin = new ListStore<Personne>();personneExistanteMagazin.add(new ArrayList<Personne>());personneExistanteCombo = new ComboBox<Personne>();personneExistanteCombo.setWidth(200);personneExistanteCombo.setEmptyText("Chercher une personne existante...");personneExistanteCombo.setTriggerAction(TriggerAction.ALL);personneExistanteCombo.setEditable(true);personneExistanteCombo.setDisplayField("fmt_nom_complet");personneExistanteCombo.setStore(personneExistanteMagazin);personneExistanteCombo.addKeyListener(new KeyListener() {public void componentKeyUp(ComponentEvent ce) {if (!ce.isNavKeyPress() && personneExistanteCombo.getRawValue() != null && personneExistanteCombo.getRawValue().length() > 0) {rafraichirPersonneExistante(personneExistanteCombo.getRawValue());}}});// TODO : dans GXT 2.0 plus besoin de l'adaptateur, on peut ajouter la combobox directement sur la toolbar//> CHECKtoolBar.add(personneExistanteCombo);Button ajouterPersonneExistanteBtn = new Button("Ajouter");ajouterPersonneExistanteBtn.addSelectionListener(new SelectionListener<ButtonEvent>() {@Overridepublic void componentSelected(ButtonEvent ce) {Personne personneExistante = personneExistanteCombo.getValue();if (personneExistante != null) {StructureAPersonne membreDuPersonnel = new StructureAPersonne("", StructureAPersonne.ROLE_EQUIPE, StructureAPersonne.ETAT_AJOUTE);membreDuPersonnel.setIdPersonne(personneExistante.getId());membreDuPersonnel.setIdProjetPersonne(personneExistante.getIdProjet());membreDuPersonnel.setNom(personneExistante.getNom());membreDuPersonnel.setPrenom(personneExistante.getPrenom());membreDuPersonnel.setTelephone(personneExistante.getTelephone());membreDuPersonnel.setCourriel(personneExistante.selectionnerCourriel(1));membreDuPersonnel.setSpecialite(personneExistante.afficherSpecialite());ajouterMembreAGrillePersonnel(membreDuPersonnel);}}});toolBar.add(ajouterPersonneExistanteBtn);cp.setTopComponent(toolBar);ColumnModel cm = new ColumnModel(configs);grillePersonnel = new EditorGrid<StructureAPersonne>(personnelGrilleMagazin, cm);grillePersonnel.setHeight("100%");grillePersonnel.setBorders(true);grillePersonnel.setSelectionModel(sm);grillePersonnel.addPlugin(checkColumn);grillePersonnel.addPlugin(r);grillePersonnel.getView().setForceFit(true);grillePersonnel.setAutoExpandColumn("specialite");grillePersonnel.setStripeRows(true);grillePersonnel.setTrackMouseOver(true);personnelGrilleMagazin.addListener(Store.Update, new Listener<StoreEvent<StructureAPersonne>>() {public void handleEvent(StoreEvent<StructureAPersonne> ce) {StructureAPersonne structureAPersonne = ce.getModel();String etat = structureAPersonne.get("etat");if (etat!=null && !etat.equals(aDonnee.ETAT_AJOUTE) && structureAPersonne!=null && !UtilString.isEmpty(structureAPersonne.getId())) {System.out.println("modifier");ce.getModel().set("etat", aDonnee.ETAT_MODIFIE);} else {System.out.println("ajoute");}}});cp.add(grillePersonnel);personnelOnglet.add(cp);return personnelOnglet;}private TabItem creerOngletIdentification() {//+-----------------------------------------------------------------------------------------------------------+// Onlget formulaire IDENTIFICATIONidentificationOnglet = creerOnglet("Identification", "identification");identificationOnglet.addListener(Events.Select, new Listener<ComponentEvent>() {public void handleEvent(ComponentEvent be) {peuplerStructureIdentification();identificationOnglet.layout();}});//+-----------------------------------------------------------------------------------------------------------+// Champs cachésidStructureChp = new HiddenField<String>();//+-----------------------------------------------------------------------------------------------------------+// Fieldset IDENTITÉFieldSet fieldSetIdentite = new FieldSet();fieldSetIdentite.setHeading("Identité");fieldSetIdentite.setCollapsible(true);fieldSetIdentite.setLayout(creerFormLayout(120, LabelAlign.LEFT));nomStructureChp = new TextField<String>();nomStructureChp.setTabIndex(tabIndex++);nomStructureChp.setFieldLabel("Nom de la structure");nomStructureChp.setAllowBlank(false);nomStructureChp.getMessages().setBlankText("Ce champ est obligatoire.");nomStructureChp.addStyleName(ComposantClass.OBLIGATOIRE);nomStructureChp.addListener(Events.Valid, creerEcouteurChampObligatoire());fieldSetIdentite.add(nomStructureChp, new FormData(450, 0));ModelType modelTypeProjets = new ModelType();modelTypeProjets.setRoot("projets");modelTypeProjets.setTotalName("nbElements");modelTypeProjets.addField("cpr_nom");modelTypeProjets.addField("cpr_id_projet");String displayNameProjets = "cpr_nom";ProxyProjets<ModelData> proxyProjets = new ProxyProjets<ModelData>();projetsCombo = new ChampComboBoxRechercheTempsReelPaginable(proxyProjets, modelTypeProjets, displayNameProjets);projetsCombo.getCombo().setTabIndex(tabIndex++);projetsCombo.getCombo().setFieldLabel(i18nC.projetChamp());projetsCombo.getCombo().setForceSelection(true);projetsCombo.getCombo().addStyleName(ComposantClass.OBLIGATOIRE);projetsCombo.getCombo().addListener(Events.Valid, Formulaire.creerEcouteurChampObligatoire());projetsCombo.setWidth(120, 450);fieldSetIdentite.add(projetsCombo, new FormData(450, 0));// Création du sous-formulaire : AcronymeLayoutContainer ligne = new LayoutContainer();ligne.setLayout(new ColumnLayout());ligne.setSize(600, -1);LayoutContainer gauche = new LayoutContainer();gauche.setLayout(creerFormLayout(120, LabelAlign.LEFT));LayoutContainer droite = new LayoutContainer();droite.setLayout(creerFormLayout(10, LabelAlign.LEFT));ListStore<InterneValeur> acronymes = new ListStore<InterneValeur>();acronymes.add(InterneValeurListe.getTypeAcronyme());comboAcronyme = new ComboBox<InterneValeur>();comboAcronyme.setTabIndex(tabIndex++);comboAcronyme.setEmptyText("Sélectioner un type d'acronyme...");comboAcronyme.setFieldLabel("Type d'acronyme");comboAcronyme.setDisplayField("nom");comboAcronyme.setStore(acronymes);comboAcronyme.setEditable(false);comboAcronyme.setTypeAhead(true);comboAcronyme.setTriggerAction(TriggerAction.ALL);comboAcronyme.addSelectionChangedListener(new SelectionChangedListener<InterneValeur>() {@Overridepublic void selectionChanged(SelectionChangedEvent<InterneValeur> se) {String acronymeAbr = se.getSelectedItem().getAbr();if (acronymeAbr.equals("IH")) {mnhnChp.hide();ihChp.show();} else if (acronymeAbr.equals("MNHN")) {ihChp.hide();mnhnChp.show();} else if (acronymeAbr.equals("")) {ihChp.hide();mnhnChp.hide();comboAcronyme.clearSelections();}}});gauche.add(comboAcronyme, new FormData("95%"));ihChp = new TextField<String>();ihChp.setTabIndex(tabIndex++);ihChp.setLabelSeparator("");ihChp.setToolTip("Index Herbariorum : herbier de plus de 5000 échantillons");ihChp.hide();droite.add(ihChp, new FormData("95%"));mnhnChp = new TextField<String>();mnhnChp.setTabIndex(tabIndex++);mnhnChp.setLabelSeparator("");mnhnChp.setToolTip("Acronyme MNHN : herbier de moins de 5000 échantillons");mnhnChp.hide();droite.add(mnhnChp, new FormData("95%"));ligne.add(gauche, new ColumnData(.5));ligne.add(droite, new ColumnData(.5));fieldSetIdentite.add(ligne);// Création du sous-formulaire : Type de StructureLayoutContainer ligneTs = new LayoutContainer();ligneTs.setLayout(new ColumnLayout());ligneTs.setSize(600, -1);LayoutContainer gaucheTs = new LayoutContainer();gaucheTs.setLayout(creerFormLayout(120, LabelAlign.LEFT));LayoutContainer droiteTs = new LayoutContainer();droiteTs.setLayout(creerFormLayout(10, LabelAlign.LEFT));ListStore<InterneValeur> typesStructure = new ListStore<InterneValeur>();typesStructure.add(InterneValeurListe.getTypeStructure());comboTypeStructure = new ComboBox<InterneValeur>();comboTypeStructure.setTabIndex(tabIndex++);comboTypeStructure.setEmptyText("Sélectioner un type de structure...");comboTypeStructure.setFieldLabel("Statut des structures");comboTypeStructure.setDisplayField("nom");comboTypeStructure.setStore(typesStructure);comboTypeStructure.setEditable(false);comboTypeStructure.setTypeAhead(true);comboTypeStructure.setTriggerAction(TriggerAction.ALL);comboTypeStructure.addSelectionChangedListener(new SelectionChangedListener<InterneValeur>() {@Overridepublic void selectionChanged(SelectionChangedEvent<InterneValeur> se) {String typeAbr = se.getSelectedItem().getAbr();if (typeAbr.equals("stpu")) {comboLstpr.hide();comboLstpu.show();} else if (typeAbr.equals("stpr")) {comboLstpu.hide();comboLstpr.show();} else if (typeAbr.equals("")) {comboLstpr.hide();comboLstpu.hide();comboTypeStructure.clearSelections();}}});gaucheTs.add(comboTypeStructure, new FormData("95%"));magazinLstpu = new ListStore<Valeur>();comboLstpu = new ComboBox<Valeur>();comboLstpu.setTabIndex(tabIndex++);//comboLstpu.setFieldLabel("Statut des structures publiques");comboLstpu.setLabelSeparator("");comboLstpu.setDisplayField("nom");comboLstpu.setEditable(false);comboLstpu.setTriggerAction(TriggerAction.ALL);comboLstpu.setStore(magazinLstpu);comboLstpu.hide();droiteTs.add(comboLstpu, new FormData("95%"));mediateur.obtenirListeValeurEtRafraichir(this, "stpu");magazinLstpr = new ListStore<Valeur>();comboLstpr = new ComboBox<Valeur>();comboLstpr.setTabIndex(tabIndex++);//comboLstpr.setFieldLabel("Statut des structures privées");comboLstpr.setLabelSeparator("");comboLstpr.setDisplayField("nom");comboLstpr.setEditable(false);comboLstpr.setTriggerAction(TriggerAction.ALL);comboLstpr.setStore(magazinLstpr);comboLstpr.hide();droiteTs.add(comboLstpr, new FormData("95%"));mediateur.obtenirListeValeurEtRafraichir(this, "stpr");ligneTs.add(gaucheTs, new ColumnData(0.5));ligneTs.add(droiteTs, new ColumnData(0.5));fieldSetIdentite.add(ligneTs);dateFondationChp = new TextField();dateFondationChp.setTabIndex(tabIndex++);dateFondationChp.setFieldLabel("Date de fondation");fieldSetIdentite.add(dateFondationChp);nbreTotalPersonneStructureChp = new NumberField();nbreTotalPersonneStructureChp.setFieldLabel("Nombre de personne travaillant dans l'institution");nbreTotalPersonneStructureChp.setFormat(NumberFormat.getFormat("#"));nbreTotalPersonneStructureChp.setToolTip(i18nC.champNumerique());fieldSetIdentite.add(nbreTotalPersonneStructureChp);identificationOnglet.add(fieldSetIdentite);//+-----------------------------------------------------------------------------------------------------------+// Fieldset DESCRIPTIONFieldSet fieldSetDescription = new FieldSet();fieldSetDescription.setHeading("Description");fieldSetDescription.setCollapsible(true);fieldSetDescription.setLayout(creerFormLayout(120, LabelAlign.LEFT));descriptionChp = new TextArea();descriptionChp.setTabIndex(tabIndex++);descriptionChp.setFieldLabel("Description");fieldSetDescription.add(descriptionChp, new FormData(550, 0));conditionAccesChp = new TextArea();conditionAccesChp.setTabIndex(tabIndex++);conditionAccesChp.setFieldLabel("Conditions d'accès");fieldSetDescription.add(conditionAccesChp, new FormData(550, 0));conditionUsageChp = new TextArea();conditionUsageChp.setTabIndex(tabIndex++);conditionUsageChp.setFieldLabel("Conditions d'usage");fieldSetDescription.add(conditionUsageChp, new FormData(550, 0));identificationOnglet.add(fieldSetDescription);//+-----------------------------------------------------------------------------------------------------------+// Fieldset ADRESSELayoutContainer principalFdAdresse = new LayoutContainer();principalFdAdresse.setLayout(new ColumnLayout());principalFdAdresse.setSize(700, -1);LayoutContainer gaucheFdAdresse = new LayoutContainer();gaucheFdAdresse.setLayout(creerFormLayout(null, LabelAlign.LEFT));LayoutContainer droiteFdAdresse = new LayoutContainer();droiteFdAdresse.setLayout(creerFormLayout(100, LabelAlign.LEFT));droiteFdAdresse.setWidth(300);FieldSet fieldSetAdresse = new FieldSet();fieldSetAdresse.setHeading("Adresse");fieldSetAdresse.setCollapsible(true);fieldSetAdresse.setLayout(creerFormLayout(null, LabelAlign.LEFT));adrChp = new TextArea();adrChp.setTabIndex(tabIndex++);adrChp.setFieldLabel("Adresse (Nom du batiment, rue...)");fieldSetAdresse.add(adrChp, new FormData(550, 0));adrComplementChp = new TextArea();adrComplementChp.setTabIndex(tabIndex++);adrComplementChp.setFieldLabel("Complément d'adresse (BP, étage...)");fieldSetAdresse.add(adrComplementChp, new FormData(550, 0));cpChp = new TextField<String>();cpChp.setTabIndex(tabIndex++);cpChp.setFieldLabel("Code postal");gaucheFdAdresse.add(cpChp, new FormData("95%"));villeChp = new TextField<String>();villeChp.setTabIndex(tabIndex++);villeChp.setFieldLabel("Ville");gaucheFdAdresse.add(villeChp, new FormData("95%"));ModelType modelTypesPays = new ModelType();modelTypesPays.setRoot("valeurs");modelTypesPays.setTotalName("nbElements");modelTypesPays.addField("cmlv_nom");modelTypesPays.addField("cmlv_id_valeur");modelTypesPays.addField("cmlv_abreviation");modelTypesPays.addField("cmlv_description");String displayNamePays = "cmlv_nom";String nomListeTypes = "pays";ProxyValeur<ModelData> proxyPays = new ProxyValeur<ModelData>(nomListeTypes);comboPays = new ChampComboBoxRechercheTempsReelPaginable(proxyPays, modelTypesPays, displayNamePays);comboPays.setWidth(100,300);comboPays.getCombo().setTabIndex(tabIndex++);comboPays.getCombo().setFieldLabel("Pays");comboPays.getCombo().setForceSelection(true);comboPays.getCombo().setTemplate(getTemplatePays());SelectionChangedListener<ModelData> selectionChange = new SelectionChangedListener<ModelData>() {public void selectionChanged(SelectionChangedEvent se) {// Rafraichir avec le pays sélectionnécomboRegion.clear();obtenirListeRegionParPays((new Valeur(se.getSelectedItem())).getAbreviation().toString());}};comboPays.getCombo().addSelectionChangedListener(selectionChange);droiteFdAdresse.add(comboPays, new FormData("95%"));magazinRegion = new ListStore<Valeur>();comboRegion = new ComboBox<Valeur>();comboRegion.setTabIndex(tabIndex++);comboRegion.setFieldLabel("Région");comboRegion.setEmptyText("Sélectionner une région...");comboRegion.setDisplayField("nom");comboRegion.setTypeAhead(true);comboRegion.setTriggerAction(TriggerAction.ALL);comboRegion.setStore(magazinRegion);droiteFdAdresse.add(comboRegion, new FormData("95%"));latitudeChp = new TextField<String>();latitudeChp.setRegex(Pattern.latitude);latitudeChp.setToolTip("Format : nombre décimal positif ou négatif de 0 à 90.");latitudeChp.getMessages().setRegexText("La valeur saisie n'est pas une latitude valide. Exemples de latitude : -45,302010 ou 45.252423 ou 25,16.");latitudeChp.setTabIndex(tabIndex++);latitudeChp.setFieldLabel("Latitude (Nord)");gaucheFdAdresse.add(latitudeChp, new FormData("95%"));longitudeChp = new TextField<String>();longitudeChp.setRegex(Pattern.longitude);longitudeChp.setToolTip("Format : nombre décimal positif ou négatif de 0 à 180.");longitudeChp.getMessages().setRegexText("La valeur saisie n'est pas une longitude valide. Exemples de longitude : -150,302010 ou 150.252423 ou 25,16.");longitudeChp.setTabIndex(tabIndex++);longitudeChp.setFieldLabel("Longitude (Est)");droiteFdAdresse.add(longitudeChp, new FormData("95%"));principalFdAdresse.add(gaucheFdAdresse, new ColumnData(.5));principalFdAdresse.add(droiteFdAdresse, new ColumnData(.5));fieldSetAdresse.add(principalFdAdresse);identificationOnglet.add(fieldSetAdresse);//+-----------------------------------------------------------------------------------------------------------+// Fieldset TÉLÉPHONE et EMAILLayoutContainer principalFdTelMail = new LayoutContainer();principalFdTelMail.setLayout(new ColumnLayout());principalFdTelMail.setSize(700, -1);LayoutContainer gaucheFdTelMail = new LayoutContainer();gaucheFdTelMail.setLayout(creerFormLayout(60, LabelAlign.LEFT));LayoutContainer droiteFdTelMail = new LayoutContainer();droiteFdTelMail.setLayout(creerFormLayout(60, LabelAlign.LEFT));FieldSet fieldSetTelMail = new FieldSet();fieldSetTelMail.setHeading("Communication");fieldSetTelMail.setCollapsible(true);fieldSetTelMail.setLayout(creerFormLayout(null, LabelAlign.LEFT));telChp = new TextField<String>();telChp.setTabIndex(tabIndex++);telChp.setFieldLabel("Téléphone fixe");gaucheFdTelMail.add(telChp, new FormData("95%"));faxChp = new TextField<String>();faxChp.setTabIndex(tabIndex++);faxChp.setFieldLabel("Fax");droiteFdTelMail.add(faxChp, new FormData("95%"));emailChp = new TextField<String>();emailChp.setTabIndex(tabIndex++);emailChp.setFieldLabel("Courriel");emailChp.setToolTip("Saisir le courriel de l'organisation, pas de courriel individuel. Ex. : accueil@organisation.org");gaucheFdTelMail.add(emailChp, new FormData("95%"));urlChp = new TextField<String>();urlChp.setTabIndex(tabIndex++);urlChp.setFieldLabel("Site web");droiteFdTelMail.add(urlChp, new FormData("95%"));principalFdTelMail.add(gaucheFdTelMail, new ColumnData(.5));principalFdTelMail.add(droiteFdTelMail, new ColumnData(.5));fieldSetTelMail.add(principalFdTelMail);identificationOnglet.add(fieldSetTelMail);return identificationOnglet;}public void obtenirListeRegionParPays(String strPays) {mediateur.obtenirListeRegionsEtRafraichir(this, "region", strPays);}private void mettreAJourRegion() {//Met à jour la combo box en sélectionnant la valeur enregistrée pour la personneif (identification.get("ce_truk_region") != null && comboRegion.getStore().getCount() > 0) {Valeur valeurRegion = comboRegion.getStore().findModel("id_valeur", identification.get("ce_truk_region"));if (valeurRegion!=null) {comboRegion.setValue(valeurRegion);} else if (identification.get("ce_truk_region").toString().startsWith("AUTRE##")) {comboRegion.setRawValue(identification.get("ce_truk_region").toString().replaceFirst("^AUTRE##", ""));}}}private native String getTemplatePays() /*-{return ['<tpl for=".">','<div class="x-combo-list-item">{cmlv_nom} ({cmlv_abreviation})</div>','</tpl>'].join("");}-*/;private void peuplerCasesACocher(String donnees, CheckBoxGroup groupeCac, TextField<String> champAutre) {String[] valeurs = donnees.split(";;");for (int i = 0; i < valeurs.length; i++) {if (valeurs[i].startsWith("AUTRE##")) {champAutre.setValue(valeurs[i].replaceFirst("^AUTRE##", ""));} else {//TODO : check : List<CheckBox> cases = groupeCac.getAll();List<Field<?>> cases = groupeCac.getAll();for (int j = 0; j < cases.size(); j++) {if (cases.get(j).getId().equals("val-"+valeurs[i])) {((CheckBox) cases.get(j)).setValue(true);}}}}}private void peuplerBoutonsRadio(String valeur, RadioGroup groupeBr) {//List<Radio> boutons = groupeBr.getAll();List<Field<?>> boutons = groupeBr.getAll();String id = valeur+"_"+groupeBr.getName().replace("_grp", "");for (int i = 0; i < boutons.size(); i++) {if (boutons.get(i).getId().equals(id)) {((Radio) boutons.get(i)).setValue(true);}}}private String creerChaineDenormalisee(List<CheckBox> liste) {String identifiants = "";if (liste != null) {int taille = liste.size();for (int i = 0; i < taille; i++) {CheckBox cac = liste.get(i);if (cac.isEnabled()) {identifiants = identifiants.concat(";;"+cac.getData("id"));}}identifiants.replaceFirst("^;;", "");}return identifiants;}public void afficherChampSupplementaire(Radio radioBtn) {//GWT.log("Nom btn : "+radioBtn.getName()+" - Nom group : "+radioBtn.getGroup().getName(), null);// Valeur du bouton radio déclenchant l'affichage des composants cachésString valeurPourAfficher = "oui";// Construction de la liste des composants à afficher/cacherString radioGroupeNom = radioBtn.getGroup().getName();ArrayList<Object> composants = new ArrayList<Object>();if (radioGroupeNom.equals("action_mark_grp")) {composants.add(actionTrukCp);} else if (radioGroupeNom.equals("future_action_mark_grp")) {composants.add(futureActionChp);} else if (radioGroupeNom.equals("sans_motif_acces_mark_grp")) {composants.add(sansMotifAccesChp);} else if (radioGroupeNom.equals("avec_motif_acces_mark_grp")) {composants.add(avecMotifAccesChp);} else if (radioGroupeNom.equals("recherche_mark_grp")) {composants.add(provenanceRechercheTrukCp);composants.add(typeRechercheTrukCp);} else if (radioGroupeNom.equals("formation_mark_grp")) {composants.add(formationChp);} else if (radioGroupeNom.equals("collection_commune_mark_grp")) {composants.add(collectionAutreTrukCp);} else if (radioGroupeNom.equals("restauration_mark_grp")) {composants.add(opRestauTrukCp);} else if (radioGroupeNom.equals("traitement_mark_grp")) {composants.add(traitementTrukCp);} else if (radioGroupeNom.equals("echantillon_acquisition_mark_grp")) {composants.add(traitementAcquisitionMarkRGrpChp);} else if (radioGroupeNom.equals("traitement_acquisition_mark_grp")) {composants.add(traitementAcquisitionMarkLabel);composants.add(poisonTraitementTrukCp);composants.add(insecteTraitementTrukCp);} else if (radioGroupeNom.equals("materiel_conservation_ce_grp")) {composants.add(autreMaterielTrukCp);valeurPourAfficher = "non";}// Nous affichons/cachons les composant de la listefinal int nbreComposants = composants.size();//GWT.log("Id : "+radioBtn.getId()+" - Class : "+radioBtn.getClass().toString()+"- Taille : "+tailleMax, null);//Window.alert("Radio grp nom : "+radioGroupeNom+" - Id btn : "+radioBtn.getId()+" - Class : "+radioBtn.getClass().toString()+"- Taille : "+tailleMax);for (int i = 0; i < nbreComposants; i++) {// En fonction du type de bouton cliquer, on affiche ou cache les champsString type = radioBtn.getBoxLabel().toLowerCase();//GWT.log(type, null);if (radioBtn.getValue() == true) {if (type.equals(valeurPourAfficher)) {((Component) composants.get(i)).show();} else {((Component) composants.get(i)).hide();}}// Si on a à faire à un ContentPanel, on l'actualise pour déclencher l'affichageif (composants.get(i) instanceof ContentPanel) {((ContentPanel) composants.get(i)).layout();}}}public void rafraichir(Object nouvellesDonnees) {try {if (nouvellesDonnees instanceof Information) {Information info = (Information) nouvellesDonnees;rafraichirInformation(info);} else if (nouvellesDonnees instanceof ValeurListe) {ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;rafraichirValeurListe(listeValeurs);} else {GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);}} catch (Exception e) {GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), e);}controlerFermeture();}public void rafraichirInformation(Information info) {if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {GWT.log("MESSAGES:\n"+info.getMessages().toString(), null);}if (info.getType().equals("modif_structure")) {InfoLogger.display("Modification d'une institution", info.toString());} else if (info.getType().equals("ajout_structure")) {if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String) {String structureId = (String) info.getDonnee(0);InfoLogger.display("Ajout d'une Institution", "L'intitution '"+structureId+"' a bien été ajoutée");// Suite à la récupération de l'id de l'institution nouvellement ajoutée nous ajoutons le personnelmediateur.ajouterStructureAPersonne(this, structureId, personnelAjoute);} else {InfoLogger.display("Ajout d'une Institution", info.toString());}} else if (info.getType().equals("modif_structure_a_personne")) {InfoLogger.display("Modification du Personnel", info.toString());GWT.log("Decompte:"+decompteRafraichissementPersonnel, null);testerLancementRafraichirPersonnel();} else if (info.getType().equals("suppression_structure_a_personne")) {InfoLogger.display("Suppression du Personnel", info.toString());GWT.log("Decompte:"+decompteRafraichissementPersonnel, null);testerLancementRafraichirPersonnel();} else if (info.getType().equals("ajout_structure_a_personne")) {InfoLogger.display("Ajout du Personnel", info.toString());GWT.log("Decompte:"+decompteRafraichissementPersonnel, null);testerLancementRafraichirPersonnel();} else if (info.getType().equals("selection_structure")) {InfoLogger.display("Modification d'une institution", info.toString());String titre = i18nC.titreModifFormStructurePanneau();if (info.getDonnee(0) != null) {identification = (Structure) info.getDonnee(0);if (onglets.getSelectedItem().equals(identificationOnglet)) {peuplerStructureIdentification();}// Composition du titretitre += " - ID : "+identification.getId();}if (info.getDonnee(1) != null) {conservation = (StructureConservation) info.getDonnee(1);if (onglets.getSelectedItem().equals(conservationOnglet)) {peuplerStructureConservation();}}if (info.getDonnee(2) != null) {valorisation = (StructureValorisation) info.getDonnee(2);if (valorisation != null) {if (onglets.getSelectedItem().equals(valorisationOnglet)) {peuplerStructureValorisation();}}}} else if (info.getType().equals("liste_structure_a_personne")) {if (info.getDonnee(0) != null) {personnel = (StructureAPersonneListe) info.getDonnee(0);peuplerStructurePersonnel();personnelOnglet.layout();InfoLogger.display("Chargement du Personnel", "ok");// Remise à zéro des modification dans la liste du personnelpersonnelModifie = new StructureAPersonneListe();personnelAjoute = new StructureAPersonneListe();personnelSupprime = new StructureAPersonneListe();}} else if (info.getType().equals("liste_personne")) {if (info.getDonnee(0) != null) {PersonneListe personnes = (PersonneListe) info.getDonnee(0);List<Personne> liste = personnes.toList();personneExistanteMagazin.removeAll();personneExistanteMagazin.add(liste);personneExistanteCombo.setStore(personneExistanteMagazin);personneExistanteCombo.expand();}}}public void rafraichirValeurListe(ValeurListe listeValeurs) {List<Valeur> liste = listeValeurs.toList();// Test pour savoir si la liste contient des élémentsif (liste.size() > 0) {if (listeValeurs.getId().equals(config.getListeId("stpr"))) {magazinLstpr.removeAll();magazinLstpr.add(liste);comboLstpr.setStore(magazinLstpr);}if (listeValeurs.getId().equals(config.getListeId("stpu"))) {magazinLstpu.removeAll();magazinLstpu.add(liste);comboLstpu.setStore(magazinLstpu);}if (listeValeurs.getId().equals(config.getListeId("statut"))) {magazinLiStatut.removeAll();magazinLiStatut.add(liste);comboLiStatut.setStore(magazinLiStatut);}if (listeValeurs.getId().equals(config.getListeId("fonction"))) {// FIXME : le store ne contient pas tout le temps les données, chose étrange.// On stocke donc les données dans une variables de la classe pour recharger le store si besoin.fonctionsListe = liste;fonctionsMagazin.removeAll();fonctionsMagazin.add(liste);fonctionsCombo.setStore(fonctionsMagazin);}/*if (listeValeurs.getId().equals(config.getListeId("pays"))) {magazinPays.removeAll();magazinPays.add(liste);comboPays.setStore(magazinPays);}*/if (listeValeurs.getId().equals(config.getListeId("region"))) {magazinRegion.removeAll();magazinRegion.add(liste);comboRegion.setStore(magazinRegion);mettreAJourRegion();}if (listeValeurs.getId().equals(config.getListeId("localStockage"))) {localStockageAutreChp = new TextField<String>();creerChoixMultipleCac(localStockageTrukCp, localStockageTrukCacGrpChp, listeValeurs, localStockageAutreChp);}if (listeValeurs.getId().equals(config.getListeId("meubleStockage"))) {meubleStockageAutreChp = new TextField<String>();creerChoixMultipleCac(meubleStockageTrukCp, meubleStockageTrukCacGrpChp, listeValeurs, meubleStockageAutreChp);}if (listeValeurs.getId().equals(config.getListeId("parametreStockage"))) {parametreStockageAutreChp = new TextField<String>();creerChoixMultipleCac(parametreStockageTrukCp, parametreStockageTrukCacGrpChp, listeValeurs, parametreStockageAutreChp);}if (listeValeurs.getId().equals(config.getListeId("autreCollection"))) {if (collectionAutreTrukCp != null && collectionAutreTrukCp.getItemByItemId("collectionAutreTrukCacGrpChp") == null) {collectionAutreTrukCacGrpChp.setId("collectionAutreTrukCacGrpChp");collectionAutreAutreChp = new TextField<String>();creerChoixMultipleCac(collectionAutreTrukCp, collectionAutreTrukCacGrpChp, listeValeurs, collectionAutreAutreChp);}if (autreCollectionTrukCp != null && autreCollectionTrukCp.getItemByItemId("autreCollectionTrukCacGrpChp") == null) {autreCollectionTrukCacGrpChp.setId("autreCollectionTrukCacGrpChp");autreCollectionAutreChp = new TextField<String>();creerChoixMultipleCac(autreCollectionTrukCp, autreCollectionTrukCacGrpChp, listeValeurs, autreCollectionAutreChp);}}if (listeValeurs.getId().equals(config.getListeId("opRestau"))) {opRestauAutreChp = new TextField<String>();creerChoixMultipleCac(opRestauTrukCp, opRestauTrukCacGrpChp, listeValeurs, opRestauAutreChp);}if (listeValeurs.getId().equals(config.getListeId("onep"))) {creerChoixUniqueBoutonRadio(materielConservationCeRGrpChp, listeValeurs);materielConservationCp.add(materielConservationCeRGrpChp);materielConservationCp.layout();}if (listeValeurs.getId().equals(config.getListeId("autreMateriel"))) {autreMaterielAutreChp = new TextField<String>();creerChoixMultipleCac(autreMaterielTrukCp, autreMaterielTrukCacGrpChp, listeValeurs, autreMaterielAutreChp);}if (listeValeurs.getId().equals(config.getListeId("poisonTraitement"))) {poisonTraitementAutreChp = new TextField<String>();creerChoixMultipleCac(poisonTraitementTrukCp, poisonTraitementTrukCacGrpChp, listeValeurs, poisonTraitementAutreChp);}if (listeValeurs.getId().equals(config.getListeId("insecteTraitement"))) {if (traitementTrukCp != null && traitementTrukCp.getItemByItemId("traitementTrukCacGrpChp") == null) {traitementTrukCacGrpChp.setId("traitementTrukCacGrpChp");traitementAutreChp = new TextField<String>();creerChoixMultipleCac(traitementTrukCp, traitementTrukCacGrpChp, listeValeurs, traitementAutreChp);}if (insecteTraitementTrukCp != null && insecteTraitementTrukCp.getItemByItemId("insecteTraitementTrukCacGrpChp") == null) {insecteTraitementTrukCacGrpChp.setId("insecteTraitementTrukCacGrpChp");insecteTraitementAutreChp = new TextField<String>();creerChoixMultipleCac(insecteTraitementTrukCp, insecteTraitementTrukCacGrpChp, listeValeurs, insecteTraitementAutreChp);}}if (listeValeurs.getId().equals(config.getListeId("actionValorisation"))) {actionAutreChp = new TextField<String>();creerChoixMultipleCac(actionTrukCp, actionTrukCacGrpChp, listeValeurs, actionAutreChp);}if (listeValeurs.getId().equals(config.getListeId("continentEtFr"))) {provenanceRechercheAutreChp = new TextField<String>();creerChoixMultipleCac(provenanceRechercheTrukCp, provenanceRechercheTrukCacGrpChp, listeValeurs, provenanceRechercheAutreChp);}if (listeValeurs.getId().equals(config.getListeId("typeRecherche"))) {typeRechercheAutreChp = new TextField<String>();creerChoixMultipleCac(typeRechercheTrukCp, typeRechercheTrukCacGrpChp, listeValeurs, typeRechercheAutreChp);}//GWT.log("La liste #"+listeValeurs.getId()+" a été reçue!", null);} else {GWT.log("La liste #"+listeValeurs.getId()+" ne contient aucune valeurs!", null);}}private void testerLancementRafraichirPersonnel() {decompteRafraichissementPersonnel--;if (decompteRafraichissementPersonnel == 0) {// Nous rechargeons la liste du PersonnelrafraichirPersonnel();}}private void rafraichirPersonnel() {decompteRafraichissementPersonnel = 0;if (mode.equals(MODE_MODIFIER)) {initialiserGrillePersonnelEnModification();} else if (mode.equals(MODE_AJOUTER)) {initialiserGrillePersonnelEnAjout();}}private void rafraichirPersonneExistante(String nom) {mediateur.selectionnerPersonneParNomComplet(this, null, nom+"%");}private void ajouterMembreAGrillePersonnel(StructureAPersonne personnel) {grillePersonnel.stopEditing();personnelGrilleMagazin.insert(personnel, 0);grillePersonnel.startEditing(0, 0);}private void initialiserGrillePersonnelEnAjout() {personnelGrilleMagazin.removeAll();StructureAPersonne conservateurDesCollections = new StructureAPersonne(StructureAPersonne.FONCTION_CONSERVATEUR, StructureAPersonne.ROLE_EQUIPE, StructureAPersonne.ETAT_AJOUTE);ajouterMembreAGrillePersonnel(conservateurDesCollections);StructureAPersonne directeurDuPersonnel = new StructureAPersonne(StructureAPersonne.FONCTION_DIRECTEUR, StructureAPersonne.ROLE_EQUIPE, StructureAPersonne.ETAT_AJOUTE);ajouterMembreAGrillePersonnel(directeurDuPersonnel);personnelOnglet.layout();}private void initialiserGrillePersonnelEnModification() {mediateur.selectionnerStructureAPersonne(this, identification.getId(), StructureAPersonne.ROLE_EQUIPE);}}