Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 865 → Rev 867

/trunk/src/org/tela_botanica/client/modeles/Collection.java
45,6 → 45,14
this.set("ce_projet", idProjet);
}
// COLLECTION MERE ID
public String getCollectionMereId() {
return renvoyerValeurCorrecte("ce_mere");
}
public void setCollectionMereId(String collectionMereId) {
this.set("ce_mere", collectionMereId);
}
// COLLECTION MERE NOM
public String getCollectionMereNom() {
return renvoyerValeurCorrecte("collection_mere_nom");
173,6 → 181,46
this.set("ce_type_depot", typeDepot);
}
// COUVERTURE LIEU
public String getCouvertureLieu() {
return renvoyerValeurCorrecte("truk_couverture_lieu");
}
public void setCouvertureLieu(String couvertureLieu) {
this.set("truk_couverture_lieu", couvertureLieu);
}
// SPECIMEN TYPE
public String getSpecimenType() {
return renvoyerValeurCorrecte("ce_specimen_type");
}
public void setSpecimenType(String specimenType) {
this.set("ce_specimen_type", specimenType);
}
// SPECIMEN TYPE NOMBRE
public String getSpecimenTypeNbre() {
return renvoyerValeurCorrecte("specimen_type_nbre");
}
public void setSpecimenTypeNbre(String specimenTypeNbre) {
this.set("specimen_type_nbre", specimenTypeNbre);
}
// SPECIMEN TYPE NOMBRE PRECISION
public String getSpecimenTypeNbrePrecision() {
return renvoyerValeurCorrecte("ce_specimen_type_nbre_precision");
}
public void setSpecimenTypeNbrePrecision(String specimenTypeNbrePrecision) {
this.set("ce_specimen_type_nbre_precision", specimenTypeNbrePrecision);
}
// SPECIMEN TYPE CLASSEMENT
public String getSpecimenTypeClassement() {
return renvoyerValeurCorrecte("ce_specimen_type_classement");
}
public void setSpecimenTypeClassement(String specimenTypeClassement) {
this.set("ce_specimen_type_classement", specimenTypeClassement);
}
// +--------------------------------------------------------------------------------------------------------------+
// STRUCTURE NOM
public String getStructureNom() {
/trunk/src/org/tela_botanica/client/vues/FormulaireOnglet.java
60,4 → 60,12
public void actualiser() {
layout();
}
public void setAcces(boolean acces) {
this.setData("acces", acces);
}
public boolean etreAccede() {
return this.getData("acces");
}
}
/trunk/src/org/tela_botanica/client/vues/CollectionForm.java
10,7 → 10,6
 
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.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionListener;
26,18 → 25,18
 
public class CollectionForm extends Formulaire implements Rafraichissable {
 
private Collection collection = null;
private Collection collectionCollectee = null;
protected Collection collection = null;
protected Collection collectionCollectee = null;
 
private ChampComboBoxListeValeurs typesCollectionCombo = null;
private TabPanel onglets = null;
private TabItem generalOnglet = null;
private TabItem personneOnglet = null;
private TabItem publicationOnglet = null;
private TabItem descriptionOnglet = null;
private TabItem contenuOnglet = null;
private TabItem inventaireOnglet = null;
private CollectionFormGeneral generalOnglet = null;
private CollectionFormPersonne personneOnglet = null;
private CollectionFormPublication publicationOnglet = null;
private CollectionFormDescription descriptionOnglet = null;
private CollectionFormContenu contenuOnglet = null;
private CollectionFormInventaire inventaireOnglet = null;
private TextField<String> nomChp = null;
public CollectionForm(Mediateur mediateurCourrant, String modeDeCreation) {
59,7 → 58,7
principalFieldSet.add(nomChp, new FormData(450, 0));
typesCollectionCombo = new ChampComboBoxListeValeurs(i18nC.typeCollectionNcd(), "typeCollectionNcd", tabIndex++);
typesCollectionCombo.setValeurDefaut(Valeur.COLLECTION_NCD_HERBIER);
typesCollectionCombo.peupler(Valeur.COLLECTION_NCD_HERBIER);
typesCollectionCombo.addListener(Events.Select, new Listener<BaseEvent>() {
@Override
public void handleEvent(BaseEvent be) {
177,15 → 176,24
if (info.getDonnee(0) != null) {
collection = (Collection) info.getDonnee(0);
}
actualiserPeuplementOnglet();
peupler();
actualiserTitrePanneau();
}
}
private void actualiserPeuplementOnglet() {
// TODO : déclencher le peuplement de l'onglet courant
private void peupler() {
if (collection != null) {
nomChp.setValue(collection.getNom());
typesCollectionCombo.peupler(collection.getTypeNcd());
peuplerOnglets();
}
}
 
private void peuplerOnglets() {
generalOnglet.peupler();
}
 
private void actualiserTitrePanneau() {
String titre = i18nC.titreModifFormCollection();
// Composition du titre
246,7 → 254,8
private Collection collecterCollection() {
collectionCollectee = (Collection) collection.cloner(new Collection());
collecterOngletGeneral();
this.collecter();
collecterOnglets();
Collection collectionARetourner = null;
if (!collectionCollectee.comparer(collection)) {
255,12 → 264,15
return collectionARetourner;
}
private void collecterOngletGeneral() {
if (generalOnglet.getData("acces").equals(true)) {
}
private void collecter() {
collectionCollectee.setNom(nomChp.getValue());
collectionCollectee.setTypeNcd(typesCollectionCombo.getValue().getId());
}
private void collecterOnglets() {
generalOnglet.collecter();
}
protected boolean verifierFormulaire() {
return true;
}
/trunk/src/org/tela_botanica/client/vues/CollectionFormGeneral.java
33,6 → 33,9
 
public class CollectionFormGeneral extends FormulaireOnglet implements Rafraichissable {
private Collection collection = null;
private Collection collectionCollectee = null;
 
private HiddenField<String> idCollectionChp;
private ComboBox<Projet> projetsCombo = null;
47,7 → 50,7
private NumberField nbreTypeChp = null;
private ChampComboBoxListeValeurs classementSpecimenTypeCombo;
private ComboBox<Valeur> typeDepotCombo = null;
private ChampComboBoxListeValeurs typeDepotCombo = null;
private TextField<String> coteChp = null;
private ChampMultiValeurs idAlternatifsChp = null;
private ChampMultiValeurs nomsAlternatifsChp = null;
65,6 → 68,9
setId("general");
setText(Mediateur.i18nC.collectionGeneral());
collection = ((CollectionForm) formulaire).collection;
collectionCollectee = ((CollectionForm) formulaire).collectionCollectee;
creerChampsCache();
creerFieldsetLiaison();
creerFieldsetAdministratif();
266,16 → 272,89
this.add(typeFieldSet);
}
public void peupler() {
if (collection != null) {
idCollectionChp.setValue(collection.getId());
typeDepotCombo.peupler(collection.getTypeDepot());
coteChp.setValue(collection.getCote());
idAlternatifsChp.peupler(collection.getIdAlternatif());
nomsAlternatifsChp.peupler(collection.getNomAlternatif());
codesAlternatifsChp.peupler(collection.getCode());
descriptionChp.setValue(collection.getDescription());
descriptionSpecialisteChp.setValue(collection.getDescriptionSpecialiste());
historiqueChp.setValue(collection.getHistorique());
urlsChp.peupler(collection.getUrls());
groupementPrincipeCombo.peupler(collection.getGroupementPrincipe());
butRealisationCombo.peupler(collection.getGroupementBut());
lieuCouvertureChp.peupler(collection.getCouvertureLieu());
specimenTypeCombo.peupler(collection.getSpecimenType());
nbreTypeChp.setValue(Integer.parseInt(collection.getSpecimenTypeNbre()));
precisionTypeNbreCombo.peupler(collection.getSpecimenTypeNbrePrecision());
classementSpecimenTypeCombo.peupler(collection.getSpecimenTypeClassement());
}
}
public void collecter() {
if (etreAccede()) {
collectionCollectee.setId(idCollectionChp.getValue());
collectionCollectee.setTypeDepot(typeDepotCombo.getValeur());
collectionCollectee.setCote(coteChp.getValue());
collectionCollectee.setIdAlternatif(idAlternatifsChp.getValeurs());
collectionCollectee.setNomAlternatif(nomsAlternatifsChp.getValeurs());
collectionCollectee.setCode(codesAlternatifsChp.getValeurs());
collectionCollectee.setDescription(descriptionChp.getValue());
collectionCollectee.setDescriptionSpecialiste(descriptionSpecialisteChp.getValue());
collectionCollectee.setHistorique(historiqueChp.getValue());
collectionCollectee.setUrls(urlsChp.getValeurs());
collectionCollectee.setGroupementPrincipe(groupementPrincipeCombo.getValeur());
collectionCollectee.setGroupementBut(butRealisationCombo.getValeur());
collectionCollectee.setCouvertureLieu(lieuCouvertureChp.getValeurs());
collectionCollectee.setSpecimenType(specimenTypeCombo.getValeur());
collectionCollectee.setSpecimenTypeNbre(nbreTypeChp.getValue().toString());
collectionCollectee.setSpecimenTypeNbrePrecision(precisionTypeNbreCombo.getValeur());
collectionCollectee.setSpecimenTypeClassement(classementSpecimenTypeCombo.getValeur());
}
}
private void mettreAJourValeurComboProjets() {
if (projetsCombo.getStore() != null && collection != null) {
projetsCombo.setValue(projetsCombo.getStore().findModel("id_projet", collection.getIdProjet()));
}
}
private void mettreAJourValeurComboStructures() {
if (structuresCombo.getStore() != null && collection != null) {
structuresCombo.setValue(structuresCombo.getStore().findModel("id_structure", collection.getIdStructure()));
}
}
private void mettreAJourValeurComboCollections() {
if (collectionsCombo.getStore() != null && collection != null) {
collectionsCombo.setValue(collectionsCombo.getStore().findModel("id_collection", collection.getCollectionMereId()));
}
}
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof ProjetListe) {
ProjetListe projets = (ProjetListe) nouvellesDonnees;
Formulaire.rafraichirComboBox(projets, projetsCombo);
mettreAJourValeurComboProjets();
} else if (nouvellesDonnees instanceof StructureListe) {
StructureListe structures = (StructureListe) nouvellesDonnees;
Formulaire.rafraichirComboBox(structures, structuresCombo);
mettreAJourValeurComboStructures();
} else if (nouvellesDonnees instanceof CollectionListe) {
CollectionListe collections = (CollectionListe) nouvellesDonnees;
Formulaire.rafraichirComboBox(collections, collectionsCombo);
mettreAJourValeurComboCollections();
} else if (nouvellesDonnees instanceof ValeurListe) {
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
rafraichirValeurListe(listeValeurs);
/trunk/src/org/tela_botanica/client/composants/ChampComboBoxListeValeurs.java
83,11 → 83,19
listeValeursCode = code;
}
public void setValeurDefaut(String id) {
valeurDefautId = id;
actualiserValeurParDefaut();
public String getValeur() {
return getValue().getId();
}
public void peupler(String valeur) {
if (valeur.matches("[0-9]+")) {
valeurDefautId = valeur;
actualiserValeurParDefaut();
} else {
setRawValue(valeur);
}
}
public String getTrie() {
String champATrier = "nom";
if (nomChampATrier != null) {