Subversion Repositories eFlore/Applications.coel

Rev

Rev 1920 | Rev 1923 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1920 Rev 1922
1
package org.tela_botanica.client.vues.collection;
1
package org.tela_botanica.client.vues.collection;
2
 
2
 
3
import java.util.ArrayList;
3
import java.util.ArrayList;
4
import java.util.HashMap;
4
import java.util.HashMap;
5
import java.util.Iterator;
5
import java.util.Iterator;
6
import java.util.List;
6
import java.util.List;
7
 
7
 
8
import org.tela_botanica.client.Mediateur;
8
import org.tela_botanica.client.Mediateur;
9
import org.tela_botanica.client.composants.ChampCaseACocher;
9
import org.tela_botanica.client.composants.ChampCaseACocher;
10
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
10
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
11
import org.tela_botanica.client.composants.ChampMultiValeursMultiTypes;
11
import org.tela_botanica.client.composants.ChampMultiValeursMultiTypes;
12
import org.tela_botanica.client.composants.ChampSliderPourcentage;
12
import org.tela_botanica.client.composants.ChampSliderPourcentage;
13
import org.tela_botanica.client.composants.ChampNombre;
13
import org.tela_botanica.client.composants.ChampNombre;
14
import org.tela_botanica.client.interfaces.Rafraichissable;
14
import org.tela_botanica.client.interfaces.Rafraichissable;
15
import org.tela_botanica.client.modeles.InterneValeur;
15
import org.tela_botanica.client.modeles.InterneValeur;
16
import org.tela_botanica.client.modeles.Valeur;
16
import org.tela_botanica.client.modeles.Valeur;
17
import org.tela_botanica.client.modeles.ValeurListe;
17
import org.tela_botanica.client.modeles.ValeurListe;
18
import org.tela_botanica.client.modeles.collection.Collection;
18
import org.tela_botanica.client.modeles.collection.Collection;
19
import org.tela_botanica.client.modeles.collection.CollectionBotanique;
19
import org.tela_botanica.client.modeles.collection.CollectionBotanique;
20
import org.tela_botanica.client.modeles.collection.UniteBase;
20
import org.tela_botanica.client.modeles.collection.UniteBase;
21
import org.tela_botanica.client.modeles.collection.UniteRangement;
21
import org.tela_botanica.client.modeles.collection.UniteRangement;
-
 
22
import org.tela_botanica.client.modeles.OntologiesLocales;
-
 
23
import org.tela_botanica.client.modeles.SimpleModelData;
22
import org.tela_botanica.client.util.Debug;
24
import org.tela_botanica.client.util.Debug;
23
import org.tela_botanica.client.util.UtilString;
25
import org.tela_botanica.client.util.UtilString;
24
import org.tela_botanica.client.vues.Formulaire;
26
import org.tela_botanica.client.vues.Formulaire;
25
import org.tela_botanica.client.vues.FormulaireOnglet;
27
import org.tela_botanica.client.vues.FormulaireOnglet;
26
import com.extjs.gxt.ui.client.event.Events;
28
import com.extjs.gxt.ui.client.event.Events;
27
import com.extjs.gxt.ui.client.event.FieldEvent;
29
import com.extjs.gxt.ui.client.event.FieldEvent;
28
import com.extjs.gxt.ui.client.event.Listener;
30
import com.extjs.gxt.ui.client.event.Listener;
29
import com.extjs.gxt.ui.client.store.ListStore;
31
import com.extjs.gxt.ui.client.store.ListStore;
-
 
32
import com.extjs.gxt.ui.client.Style.SortDir;
30
import com.extjs.gxt.ui.client.widget.Label;
33
import com.extjs.gxt.ui.client.widget.Label;
31
import com.extjs.gxt.ui.client.widget.Text;
34
import com.extjs.gxt.ui.client.widget.Text;
-
 
35
import com.extjs.gxt.ui.client.widget.form.ComboBox;
-
 
36
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
32
import com.extjs.gxt.ui.client.widget.form.FieldSet;
37
import com.extjs.gxt.ui.client.widget.form.FieldSet;
33
import com.extjs.gxt.ui.client.widget.form.NumberField;
38
import com.extjs.gxt.ui.client.widget.form.NumberField;
34
import com.extjs.gxt.ui.client.widget.form.TextArea;
39
import com.extjs.gxt.ui.client.widget.form.TextArea;
35
import com.extjs.gxt.ui.client.widget.form.TextField;
40
import com.extjs.gxt.ui.client.widget.form.TextField;
36
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
41
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
37
import com.extjs.gxt.ui.client.widget.grid.EditorGrid;
42
import com.extjs.gxt.ui.client.widget.grid.EditorGrid;
38
import com.extjs.gxt.ui.client.widget.layout.FormData;
43
import com.extjs.gxt.ui.client.widget.layout.FormData;
39
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
44
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
40
import com.google.gwt.i18n.client.NumberFormat;
45
import com.google.gwt.i18n.client.NumberFormat;
41
import com.google.gwt.user.client.ui.HorizontalPanel;
46
import com.google.gwt.user.client.ui.HorizontalPanel;
-
 
47
 
42
 
48
 
43
public class CollectionFormDescription extends FormulaireOnglet implements Rafraichissable {
49
public class CollectionFormDescription extends FormulaireOnglet implements Rafraichissable {
44
	
50
	
45
	public static final String ID = "description";
51
	public static final String ID = "description";
46
	private Collection collection = null;
52
	private Collection collection = null;
47
	private CollectionBotanique collectionBotanique = null;
53
	private CollectionBotanique collectionBotanique = null;
48
	private Collection collectionCollectee = null;
54
	private Collection collectionCollectee = null;
49
	private CollectionBotanique collectionBotaniqueCollectee = null;
55
	private CollectionBotanique collectionBotaniqueCollectee = null;
50
	
56
	
51
	private static ListStore<InterneValeur> precisionStore = null;
57
	private static ListStore<InterneValeur> precisionStore = null;
52
	private ChampComboBoxListeValeurs typesCollectionBotaCombo = null;
58
	private ChampComboBoxListeValeurs typesCollectionBotaCombo = null;
53
	private NumberField nbreEchantillonChp = null;
59
	private NumberField nbreEchantillonChp = null;
54
	private EditorGrid<UniteRangement> uniteRangementGrille = null;
60
	private EditorGrid<UniteRangement> uniteRangementGrille = null;
55
	private ChampComboBoxListeValeurs etatUniteRangementCombo = null;
61
	private ComboBox<SimpleModelData> etatUniteRangementCombo = null;
56
	private EditorGrid<UniteBase> uniteBaseGrille = null;
62
	private EditorGrid<UniteBase> uniteBaseGrille = null;
57
	private ChampCaseACocher typePapierConservationChp = null;
63
	private ChampCaseACocher typePapierConservationChp = null;
58
	private ChampCaseACocher methodeConservationChp = null;
64
	private ChampCaseACocher methodeConservationChp = null;
59
	private ChampSliderPourcentage specimenFixationPourcentChp = null;
65
	private ChampSliderPourcentage specimenFixationPourcentChp = null;
60
	private ChampSliderPourcentage etiquetteFixationPourcentChp = null;
66
	private ChampSliderPourcentage etiquetteFixationPourcentChp = null;
61
	private ChampCaseACocher specimentMethodeFixationChp = null;
67
	private ChampCaseACocher specimentMethodeFixationChp = null;
62
	private ChampCaseACocher etiquetteMethodeFixationSurSupportChp = null;
68
	private ChampCaseACocher etiquetteMethodeFixationSurSupportChp = null;
63
	private ChampCaseACocher etiquetteMethodeFixationSurSpecimenChp = null;
69
	private ChampCaseACocher etiquetteMethodeFixationSurSpecimenChp = null;
64
	private ChampCaseACocher typeEcritureChp = null;
70
	private ChampCaseACocher typeEcritureChp = null;
65
	private ChampComboBoxListeValeurs traitementCombo = null;
71
	private ChampComboBoxListeValeurs traitementCombo = null;
66
	private ChampCaseACocher poisonTraitementChp = null;
72
	private ChampCaseACocher poisonTraitementChp = null;
67
	private ChampCaseACocher insecteTraitementChp = null;
73
	private ChampCaseACocher insecteTraitementChp = null;
68
	private ChampComboBoxListeValeurs etatGeneralCombo = null;
74
	private ComboBox<SimpleModelData> etatGeneralCombo = null;
69
	private ChampComboBoxListeValeurs determinationCombo = null;
75
	private ChampComboBoxListeValeurs determinationCombo = null;
70
	private ChampMultiValeursMultiTypes specimenDegradationChp = null;
76
	private ChampMultiValeursMultiTypes specimenDegradationChp = null;
71
	private ChampMultiValeursMultiTypes presentationDegradationChp = null;
77
	private ChampMultiValeursMultiTypes presentationDegradationChp = null;
72
	private Text labelPresentationDegradationChp = null;
78
	private Text labelPresentationDegradationChp = null;
73
	private ChampNombre planchesHerbier = null;
79
	private ChampNombre planchesHerbier = null;
74
	private ChampNombre nbEspeces = null;
80
	private ChampNombre nbEspeces = null;
75
	private ChampNombre nbCartonsHerbier = null;
81
	private ChampNombre nbCartonsHerbier = null;
76
	private TextField<String> cartonsHerbierFormat = null;
82
	private TextField<String> cartonsHerbierFormat = null;
77
	private ChampNombre nbLiasses = null;
83
	private ChampNombre nbLiasses = null;
78
	private TextField<String> liassesFormat = null;
84
	private TextField<String> liassesFormat = null;
79
	private TextArea autresUnitesRangement = null;
85
	private TextArea autresUnitesRangement = null;
80
		
86
		
81
	public CollectionFormDescription(Formulaire formulaireCourrant) {
87
	public CollectionFormDescription(Formulaire formulaireCourrant) {
82
		initialiserOnglet(formulaireCourrant);
88
		initialiserOnglet(formulaireCourrant);
83
		setId(ID);
89
		setId(ID);
84
		setText(Mediateur.i18nC.collectionDescription());
90
		setText(Mediateur.i18nC.collectionDescription());
85
 
91
 
86
		FormLayout formulaireLayout = (FormLayout) this.getLayout();
92
		FormLayout formulaireLayout = (FormLayout) this.getLayout();
87
		formulaireLayout.setLabelAlign(LabelAlign.LEFT);
93
		formulaireLayout.setLabelAlign(LabelAlign.LEFT);
88
		formulaireLayout.setLabelWidth(300);
94
		formulaireLayout.setLabelWidth(300);
89
		
95
		
90
		creerFieldsetTypesUniteEtat();
96
		creerFieldsetTypesUniteEtat();
91
		
97
		
92
		creerFieldsetConservation(); // Papier
98
		creerFieldsetConservation(); // Papier
93
		
99
		
94
		creerFieldsetEtiquette(); // RAS
100
		creerFieldsetEtiquette(); // RAS
95
		creerFieldsetTraitement(); // RAS
101
		creerFieldsetTraitement(); // RAS
96
		
102
		
97
		creerFieldsetPrecision(); // A supprimer ou déplacer plus tard
103
		creerFieldsetPrecision(); // A supprimer ou déplacer plus tard
98
		creerStorePrecision();
104
		creerStorePrecision();
99
		
105
		
100
		layout();
106
		layout();
101
	}
107
	}
102
	
108
	
103
	private void creerFieldsetPrecision() {
109
	private void creerFieldsetPrecision() {
104
		FieldSet precisionFieldSet = new FieldSet();
110
		FieldSet precisionFieldSet = new FieldSet();
105
		precisionFieldSet.setHeadingHtml(i18nC.collectionTitrePrecision());
111
		precisionFieldSet.setHeadingHtml(i18nC.collectionTitrePrecision());
106
		precisionFieldSet.setCollapsible(true);
112
		precisionFieldSet.setCollapsible(true);
107
		precisionFieldSet.collapse();
113
		precisionFieldSet.collapse();
108
		precisionFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
114
		precisionFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
109
		
115
		
110
		typesCollectionBotaCombo = new ChampComboBoxListeValeurs(i18nC.typeCollectionBotanique(), "typeCollectionBota");
116
		typesCollectionBotaCombo = new ChampComboBoxListeValeurs(i18nC.typeCollectionBotanique(), "typeCollectionBota");
111
		typesCollectionBotaCombo.setTabIndex(tabIndex++);
117
		typesCollectionBotaCombo.setTabIndex(tabIndex++);
112
		precisionFieldSet.add(typesCollectionBotaCombo, new FormData(250, 0));
118
		precisionFieldSet.add(typesCollectionBotaCombo, new FormData(250, 0));
113
		
119
		
114
		nbreEchantillonChp = new NumberField(); 
120
		nbreEchantillonChp = new NumberField(); 
115
		nbreEchantillonChp.setFieldLabel(i18nC.nbreEchantillon());
121
		nbreEchantillonChp.setFieldLabel(i18nC.nbreEchantillon());
116
		nbreEchantillonChp.setToolTip(i18nC.nbreEchantillonInfo());
122
		nbreEchantillonChp.setToolTip(i18nC.nbreEchantillonInfo());
117
		nbreEchantillonChp.setFormat(NumberFormat.getFormat("#"));
123
		nbreEchantillonChp.setFormat(NumberFormat.getFormat("#"));
118
		precisionFieldSet.add(nbreEchantillonChp);
124
		precisionFieldSet.add(nbreEchantillonChp);
119
		
125
		
120
		this.add(precisionFieldSet);
126
		this.add(precisionFieldSet);
121
	}
127
	}
122
	
128
	
123
	private static void creerStorePrecision() {
129
	private static void creerStorePrecision() {
124
		if (precisionStore == null) {
130
		if (precisionStore == null) {
125
			precisionStore = new ListStore<InterneValeur>();
131
			precisionStore = new ListStore<InterneValeur>();
126
			precisionStore.add(new InterneValeur(UniteRangement.COMPTE_APPROXIMATIF, Mediateur.i18nC.precisionApproximatif()));  
132
			precisionStore.add(new InterneValeur(UniteRangement.COMPTE_APPROXIMATIF, Mediateur.i18nC.precisionApproximatif()));  
127
			precisionStore.add(new InterneValeur(UniteRangement.COMPTE_EXACT, Mediateur.i18nC.precisionExact()));
133
			precisionStore.add(new InterneValeur(UniteRangement.COMPTE_EXACT, Mediateur.i18nC.precisionExact()));
128
		}
134
		}
129
	}
135
	}
130
		
136
		
131
	private void creerFieldsetConservation() {
137
	private void creerFieldsetConservation() {
132
		FieldSet conservationFieldSet = new FieldSet();
138
		FieldSet conservationFieldSet = new FieldSet();
133
		conservationFieldSet.setHeadingHtml(i18nC.collectionTitreConservation());
139
		conservationFieldSet.setHeadingHtml(i18nC.collectionTitreConservation());
134
		conservationFieldSet.setCollapsible(true);
140
		conservationFieldSet.setCollapsible(true);
135
		conservationFieldSet.collapse();
141
		conservationFieldSet.collapse();
136
		conservationFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
142
		conservationFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
137
		
143
		
138
		typePapierConservationChp = new ChampCaseACocher(i18nC.typePapierConservation(), "typePapier", true);
144
		typePapierConservationChp = new ChampCaseACocher(i18nC.typePapierConservation(), "typePapier", true);
139
		conservationFieldSet.add(typePapierConservationChp);
145
		conservationFieldSet.add(typePapierConservationChp);
140
		
146
		
141
		methodeConservationChp = new ChampCaseACocher(i18nC.methodeConservation(), "methodeRangement", true);
147
		methodeConservationChp = new ChampCaseACocher(i18nC.methodeConservation(), "methodeRangement", true);
142
		conservationFieldSet.add(methodeConservationChp);
148
		conservationFieldSet.add(methodeConservationChp);
143
		
149
		
144
		this.add(conservationFieldSet);
150
		this.add(conservationFieldSet);
145
	}
151
	}
146
	
152
	
147
	private void creerFieldsetEtiquette() {
153
	private void creerFieldsetEtiquette() {
148
		FieldSet etiquetteFieldSet = new FieldSet();
154
		FieldSet etiquetteFieldSet = new FieldSet();
149
		etiquetteFieldSet.setHeadingHtml(i18nC.collectionTitreEtiquette());
155
		etiquetteFieldSet.setHeadingHtml(i18nC.collectionTitreEtiquette());
150
		etiquetteFieldSet.setCollapsible(true);
156
		etiquetteFieldSet.setCollapsible(true);
151
		etiquetteFieldSet.collapse();
157
		etiquetteFieldSet.collapse();
152
		etiquetteFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
158
		etiquetteFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
153
		
159
		
154
		Text fixationPoucentLabel = new Text(i18nC.fixationPourcent());
160
		Text fixationPoucentLabel = new Text(i18nC.fixationPourcent());
155
		etiquetteFieldSet.add(fixationPoucentLabel);
161
		etiquetteFieldSet.add(fixationPoucentLabel);
156
		
162
		
157
		specimenFixationPourcentChp = new ChampSliderPourcentage(i18nC.specimenFixationPourcent());
163
		specimenFixationPourcentChp = new ChampSliderPourcentage(i18nC.specimenFixationPourcent());
158
		etiquetteFieldSet.add(specimenFixationPourcentChp, new FormData(200, 0));
164
		etiquetteFieldSet.add(specimenFixationPourcentChp, new FormData(200, 0));
159
		
165
		
160
		etiquetteFixationPourcentChp = new ChampSliderPourcentage(i18nC.etiquetteFixationPourcent());
166
		etiquetteFixationPourcentChp = new ChampSliderPourcentage(i18nC.etiquetteFixationPourcent());
161
		etiquetteFieldSet.add(etiquetteFixationPourcentChp, new FormData(200, 0));
167
		etiquetteFieldSet.add(etiquetteFixationPourcentChp, new FormData(200, 0));
162
		
168
		
163
		specimentMethodeFixationChp = new ChampCaseACocher(i18nC.specimenMethodeFixation(), "methodeFixation", true);
169
		specimentMethodeFixationChp = new ChampCaseACocher(i18nC.specimenMethodeFixation(), "methodeFixation", true);
164
		etiquetteFieldSet.add(specimentMethodeFixationChp);
170
		etiquetteFieldSet.add(specimentMethodeFixationChp);
165
		
171
		
166
		etiquetteMethodeFixationSurSupportChp = new ChampCaseACocher(i18nC.etiquetteMethodeFixationSurSupport(), "methodeFixation", true);
172
		etiquetteMethodeFixationSurSupportChp = new ChampCaseACocher(i18nC.etiquetteMethodeFixationSurSupport(), "methodeFixation", true);
167
		etiquetteFieldSet.add(etiquetteMethodeFixationSurSupportChp);
173
		etiquetteFieldSet.add(etiquetteMethodeFixationSurSupportChp);
168
		
174
		
169
		etiquetteMethodeFixationSurSpecimenChp = new ChampCaseACocher(i18nC.etiquetteMethodeFixationSurSpecimen(), "methodeFixationSurSpecimen", true);
175
		etiquetteMethodeFixationSurSpecimenChp = new ChampCaseACocher(i18nC.etiquetteMethodeFixationSurSpecimen(), "methodeFixationSurSpecimen", true);
170
		etiquetteFieldSet.add(etiquetteMethodeFixationSurSpecimenChp);
176
		etiquetteFieldSet.add(etiquetteMethodeFixationSurSpecimenChp);
171
		
177
		
172
		typeEcritureChp = new ChampCaseACocher(i18nC.typeEcriture(), "typeEcriture", false);
178
		typeEcritureChp = new ChampCaseACocher(i18nC.typeEcriture(), "typeEcriture", false);
173
		etiquetteFieldSet.add(typeEcritureChp);
179
		etiquetteFieldSet.add(typeEcritureChp);
174
		
180
		
175
		this.add(etiquetteFieldSet);
181
		this.add(etiquetteFieldSet);
176
	}
182
	}
177
	
183
	
178
	private void creerFieldsetTraitement() {
184
	private void creerFieldsetTraitement() {
179
		FieldSet traitementFieldSet = new FieldSet();
185
		FieldSet traitementFieldSet = new FieldSet();
180
		traitementFieldSet.setHeadingHtml(i18nC.collectionTitreTraitement());
186
		traitementFieldSet.setHeadingHtml(i18nC.collectionTitreTraitement());
181
		traitementFieldSet.setCollapsible(true);
187
		traitementFieldSet.setCollapsible(true);
182
		traitementFieldSet.collapse();
188
		traitementFieldSet.collapse();
183
		traitementFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
189
		traitementFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
184
		
190
		
185
		traitementCombo  = new ChampComboBoxListeValeurs(i18nC.collectionTraitement(), "onpi");
191
		traitementCombo  = new ChampComboBoxListeValeurs(i18nC.collectionTraitement(), "onpi");
186
		traitementCombo.setTrie("id_valeur");
192
		traitementCombo.setTrie("id_valeur");
187
		traitementFieldSet.add(traitementCombo, new FormData(300, 0));
193
		traitementFieldSet.add(traitementCombo, new FormData(300, 0));
188
		
194
		
189
		poisonTraitementChp = new ChampCaseACocher(i18nC.collectionTraitementPoison(), "poisonTraitement", true);
195
		poisonTraitementChp = new ChampCaseACocher(i18nC.collectionTraitementPoison(), "poisonTraitement", true);
190
		traitementFieldSet.add(poisonTraitementChp);
196
		traitementFieldSet.add(poisonTraitementChp);
191
		
197
		
192
		insecteTraitementChp = new ChampCaseACocher(i18nC.collectionTraitementInsecte(), "insecteTraitement", true);
198
		insecteTraitementChp = new ChampCaseACocher(i18nC.collectionTraitementInsecte(), "insecteTraitement", true);
193
		traitementFieldSet.add(insecteTraitementChp);
199
		traitementFieldSet.add(insecteTraitementChp);
194
 
200
 
195
		this.add(traitementFieldSet);
201
		this.add(traitementFieldSet);
196
	}
202
	}
197
	
203
	
198
	private void creerFieldsetTypesUniteEtat() {
204
	private void creerFieldsetTypesUniteEtat() {
199
		FieldSet etatTypesUniteFieldSet = new FieldSet();
205
		FieldSet etatTypesUniteFieldSet = new FieldSet();
200
		// Etat général et nombre d'échantillons (à changer dans l'i18n
206
		// Etat général et nombre d'échantillons (à changer dans l'i18n
201
		etatTypesUniteFieldSet.setHeadingHtml(i18nC.collectionEtatGeneralEtNombreEchantillons());
207
		etatTypesUniteFieldSet.setHeadingHtml(i18nC.collectionEtatGeneralEtNombreEchantillons());
202
		etatTypesUniteFieldSet.setCollapsible(true);
208
		etatTypesUniteFieldSet.setCollapsible(true);
203
		etatTypesUniteFieldSet.collapse();
209
		etatTypesUniteFieldSet.collapse();
204
		etatTypesUniteFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
210
		etatTypesUniteFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
205
		
211
		
206
		etatUniteRangementCombo = new ChampComboBoxListeValeurs(i18nC.collectionUniteRangementEtatGeneral(), "etat");
-
 
207
		etatUniteRangementCombo.setToolTip(i18nC.collectionUniteRangementEtatGeneralInfo());
-
 
208
		etatUniteRangementCombo.setTrie("id_valeur");
212
		etatUniteRangementCombo = creerSimpleComboBonMauvaisEtat(i18nC.collectionUniteRangementEtatGeneral());
209
		etatUniteRangementCombo.setWidth(300);
213
		etatUniteRangementCombo.setWidth(300);
210
		etatTypesUniteFieldSet.add(etatUniteRangementCombo);
214
		etatTypesUniteFieldSet.add(etatUniteRangementCombo);
211
		
215
		
212
		// Liasses et cartons d'herbier
216
		// Liasses et cartons d'herbier
213
		Label labelcartonsHerbiersFormat = new Label(i18nC.collectionCartonsHerbiers());
217
		Label labelcartonsHerbiersFormat = new Label(i18nC.collectionCartonsHerbiers());
214
		labelcartonsHerbiersFormat.setStyleName("labelChampNombreFormat");
218
		labelcartonsHerbiersFormat.setStyleName("labelChampNombreFormat");
215
		
219
		
216
		nbCartonsHerbier = new ChampNombre();
220
		nbCartonsHerbier = new ChampNombre();
217
		nbCartonsHerbier.setStyleName("champNombreFormat");
221
		nbCartonsHerbier.setStyleName("champNombreFormat");
218
		nbCartonsHerbier.setWidth(55);
222
		nbCartonsHerbier.setWidth(55);
219
		nbCartonsHerbier.setEmptyText(i18nC.collectionUniteNbre());
223
		nbCartonsHerbier.setEmptyText(i18nC.collectionUniteNbre());
220
		
224
		
221
		cartonsHerbierFormat = new TextField<String>();
225
		cartonsHerbierFormat = new TextField<String>();
222
		cartonsHerbierFormat.setStyleName("champNombreFormat");
226
		cartonsHerbierFormat.setStyleName("champNombreFormat");
223
		cartonsHerbierFormat.setEmptyText(i18nC.collectionUniteFormat());
227
		cartonsHerbierFormat.setEmptyText(i18nC.collectionUniteFormat());
224
		
228
		
225
		HorizontalPanel conteneurCartonsHerbiers = new HorizontalPanel();
229
		HorizontalPanel conteneurCartonsHerbiers = new HorizontalPanel();
226
		conteneurCartonsHerbiers.setBorderWidth(0);
230
		conteneurCartonsHerbiers.setBorderWidth(0);
227
		
231
		
228
		conteneurCartonsHerbiers.add(labelcartonsHerbiersFormat);
232
		conteneurCartonsHerbiers.add(labelcartonsHerbiersFormat);
229
		conteneurCartonsHerbiers.add(nbCartonsHerbier);
233
		conteneurCartonsHerbiers.add(nbCartonsHerbier);
230
		conteneurCartonsHerbiers.add(cartonsHerbierFormat);
234
		conteneurCartonsHerbiers.add(cartonsHerbierFormat);
231
		
235
		
232
		etatTypesUniteFieldSet.add(conteneurCartonsHerbiers);
236
		etatTypesUniteFieldSet.add(conteneurCartonsHerbiers);
233
		
237
		
234
		Label labelLiasses = new Label(i18nC.collectionLiasses());
238
		Label labelLiasses = new Label(i18nC.collectionLiasses());
235
		labelLiasses.setStyleName("labelChampNombreFormat");
239
		labelLiasses.setStyleName("labelChampNombreFormat");
236
		
240
		
237
		nbLiasses = new ChampNombre();
241
		nbLiasses = new ChampNombre();
238
		nbLiasses.setStyleName("champNombreFormat");
242
		nbLiasses.setStyleName("champNombreFormat");
239
		nbLiasses.setWidth(55);
243
		nbLiasses.setWidth(55);
240
		nbLiasses.setEmptyText(i18nC.collectionUniteNbre());
244
		nbLiasses.setEmptyText(i18nC.collectionUniteNbre());
241
		
245
		
242
		liassesFormat = new TextField<String>();
246
		liassesFormat = new TextField<String>();
243
		liassesFormat.setStyleName("champNombreFormat");
247
		liassesFormat.setStyleName("champNombreFormat");
244
		liassesFormat.setEmptyText(i18nC.collectionUniteFormat());
248
		liassesFormat.setEmptyText(i18nC.collectionUniteFormat());
245
		
249
		
246
		HorizontalPanel conteneurLiasses = new HorizontalPanel();
250
		HorizontalPanel conteneurLiasses = new HorizontalPanel();
247
		conteneurLiasses.setBorderWidth(0);
251
		conteneurLiasses.setBorderWidth(0);
248
		
252
		
249
		conteneurLiasses.add(labelLiasses);
253
		conteneurLiasses.add(labelLiasses);
250
		conteneurLiasses.add(nbLiasses);
254
		conteneurLiasses.add(nbLiasses);
251
		conteneurLiasses.add(liassesFormat);
255
		conteneurLiasses.add(liassesFormat);
252
		
256
		
253
		etatTypesUniteFieldSet.add(conteneurLiasses);
257
		etatTypesUniteFieldSet.add(conteneurLiasses);
254
		
258
		
255
		autresUnitesRangement = new TextArea();
259
		autresUnitesRangement = new TextArea();
256
		autresUnitesRangement.setStyleName("textAreaAutreUniteRangement");
260
		autresUnitesRangement.setStyleName("textAreaAutreUniteRangement");
257
		autresUnitesRangement.setHeight(90);
261
		autresUnitesRangement.setHeight(90);
258
		autresUnitesRangement.setFieldLabel(i18nC.collectionAutreUnitesRangement());
262
		autresUnitesRangement.setFieldLabel(i18nC.collectionAutreUnitesRangement());
259
		
263
		
260
		etatTypesUniteFieldSet.add(autresUnitesRangement);
264
		etatTypesUniteFieldSet.add(autresUnitesRangement);
261
		
265
		
262
		planchesHerbier = new ChampNombre();
266
		planchesHerbier = new ChampNombre();
263
		planchesHerbier.setFieldLabel(i18nC.collectionNbPlanchesHerbier());
267
		planchesHerbier.setFieldLabel(i18nC.collectionNbPlanchesHerbier());
264
		
268
		
265
		nbEspeces = new ChampNombre();
269
		nbEspeces = new ChampNombre();
266
		nbEspeces.setFieldLabel(i18nC.collectionNbEspeces());
270
		nbEspeces.setFieldLabel(i18nC.collectionNbEspeces());
267
		
271
		
268
		etatTypesUniteFieldSet.add(planchesHerbier);
272
		etatTypesUniteFieldSet.add(planchesHerbier);
269
		etatTypesUniteFieldSet.add(nbEspeces);
273
		etatTypesUniteFieldSet.add(nbEspeces);
270
		
274
		
271
		add(etatTypesUniteFieldSet);
275
		add(etatTypesUniteFieldSet);
272
		
276
		
273
		etatGeneralCombo = new ChampComboBoxListeValeurs(i18nC.collectionEtatGeneral(), "etat");
-
 
274
		etatGeneralCombo.setToolTip(i18nC.collectionEtatGeneralInfo());
-
 
275
		etatGeneralCombo.setTrie("id_valeur");
277
		etatUniteRangementCombo = creerSimpleComboBonMauvaisEtat(i18nC.collectionEtatGeneral());
276
		etatTypesUniteFieldSet.add(etatGeneralCombo, new FormData(300, 0));
278
		etatTypesUniteFieldSet.add(etatUniteRangementCombo, new FormData(300, 0));
277
		
279
		
278
		specimenDegradationChp = new ChampMultiValeursMultiTypes(i18nC.degradationSpecimen(), 150, true);
280
		specimenDegradationChp = new ChampMultiValeursMultiTypes(i18nC.degradationSpecimen(), 150, true);
279
		specimenDegradationChp.initialiserType("specimenDegradation");
281
		specimenDegradationChp.initialiserType("specimenDegradation");
280
		specimenDegradationChp.initialiserCombobox("niveauImportance");
282
		specimenDegradationChp.initialiserCombobox("niveauImportance");
281
		etatTypesUniteFieldSet.add(specimenDegradationChp);
283
		etatTypesUniteFieldSet.add(specimenDegradationChp);
282
		
284
		
283
		labelPresentationDegradationChp = new Text();
285
		labelPresentationDegradationChp = new Text();
284
		labelPresentationDegradationChp.setWidth("95%");
286
		labelPresentationDegradationChp.setWidth("95%");
285
		labelPresentationDegradationChp.setVisible(false);
287
		labelPresentationDegradationChp.setVisible(false);
286
		
288
		
287
		presentationDegradationChp = new ChampMultiValeursMultiTypes(i18nC.degradationPresentation(), 150, 200, true);
289
		presentationDegradationChp = new ChampMultiValeursMultiTypes(i18nC.degradationPresentation(), 150, 200, true);
288
		presentationDegradationChp.initialiserType("supportDegradation");
290
		presentationDegradationChp.initialiserType("supportDegradation");
289
		presentationDegradationChp.initialiserCombobox("niveauImportance");
291
		presentationDegradationChp.initialiserCombobox("niveauImportance");
290
		
292
		
291
		presentationDegradationChp.getTypes().addListener(Events.Select,
293
		presentationDegradationChp.getTypes().addListener(Events.Select,
292
			new Listener<FieldEvent>() {
294
			new Listener<FieldEvent>() {
293
				public void handleEvent(FieldEvent be) {
295
				public void handleEvent(FieldEvent be) {
294
					if (((Valeur)(be.getField().getValue())).get("id_valeur").equals("2310")) {
296
					if (((Valeur)(be.getField().getValue())).get("id_valeur").equals("2310")) {
295
						labelPresentationDegradationChp.setText(i18nC.degradationPresentationLabel());
297
						labelPresentationDegradationChp.setText(i18nC.degradationPresentationLabel());
296
						labelPresentationDegradationChp.setVisible(true);
298
						labelPresentationDegradationChp.setVisible(true);
297
					}
299
					}
298
					else {
300
					else {
299
						labelPresentationDegradationChp.setText("");
301
						labelPresentationDegradationChp.setText("");
300
						labelPresentationDegradationChp.setVisible(false);						
302
						labelPresentationDegradationChp.setVisible(false);						
301
					}
303
					}
302
				}		
304
				}		
303
			});
305
			});
304
		etatTypesUniteFieldSet.add(presentationDegradationChp);
306
		etatTypesUniteFieldSet.add(presentationDegradationChp);
305
		etatTypesUniteFieldSet.add(labelPresentationDegradationChp);
307
		etatTypesUniteFieldSet.add(labelPresentationDegradationChp);
306
		
308
		
307
		determinationCombo = new ChampComboBoxListeValeurs(i18nC.collectionDetermination(), "niveauDetermination");
309
		determinationCombo = new ChampComboBoxListeValeurs(i18nC.collectionDetermination(), "niveauDetermination");
308
		determinationCombo.setTrie("id_valeur");
310
		determinationCombo.setTrie("id_valeur");
309
		etatTypesUniteFieldSet.add(determinationCombo, new FormData(450, 0));
311
		etatTypesUniteFieldSet.add(determinationCombo, new FormData(450, 0));
310
		
312
		
311
		this.add(etatTypesUniteFieldSet);
313
		this.add(etatTypesUniteFieldSet);
312
	}
314
	}
313
	
315
	
314
	public void peupler() {
316
	public void peupler() {
315
		initialiserCollection();
317
		initialiserCollection();
316
		if (collectionBotanique != null) {
318
		if (collectionBotanique != null) {
317
			typesCollectionBotaCombo.peupler(collectionBotanique.getType());
319
			typesCollectionBotaCombo.peupler(collectionBotanique.getType());
318
			if (!UtilString.isEmpty(collectionBotanique.getNbreEchantillon())) {
320
			if (!UtilString.isEmpty(collectionBotanique.getNbreEchantillon())) {
319
				nbreEchantillonChp.setValue(Integer.parseInt(collectionBotanique.getNbreEchantillon()));
321
				nbreEchantillonChp.setValue(Integer.parseInt(collectionBotanique.getNbreEchantillon()));
320
			}
322
			}
321
			
323
			
322
			if(!collectionBotanique.getNbCartonsHerbiers().isEmpty()) {
324
			if(!collectionBotanique.getNbCartonsHerbiers().isEmpty()) {
323
				nbCartonsHerbier.setValue((Integer.parseInt(collectionBotanique.getNbCartonsHerbiers())));
325
				nbCartonsHerbier.setValue((Integer.parseInt(collectionBotanique.getNbCartonsHerbiers())));
324
			}
326
			}
325
			cartonsHerbierFormat.setValue(collectionBotanique.getFormatCartonsHerbiers());
327
			cartonsHerbierFormat.setValue(collectionBotanique.getFormatCartonsHerbiers());
326
			
328
			
327
			if(!collectionBotanique.getNbLiasses().isEmpty()) {
329
			if(!collectionBotanique.getNbLiasses().isEmpty()) {
328
				nbLiasses.setValue((Integer.parseInt(collectionBotanique.getNbLiasses())));
330
				nbLiasses.setValue((Integer.parseInt(collectionBotanique.getNbLiasses())));
329
			}
331
			}
330
			liassesFormat.setValue(collectionBotanique.getFormatLiasses());
332
			liassesFormat.setValue(collectionBotanique.getFormatLiasses());
331
			
333
			
332
			autresUnitesRangement.setValue(collectionBotanique.getAutresUnitesRangement());
334
			autresUnitesRangement.setValue(collectionBotanique.getAutresUnitesRangement());
333
 
335
 
334
			etatUniteRangementCombo.peupler(collectionBotanique.getUniteRangementEtat());
336
			remplirSimpleCombo(etatUniteRangementCombo, collectionBotanique.getUniteRangementEtat());
335
			
337
			
336
			
338
			
337
			if(!collectionBotanique.getNbPlanchesHerbiers().isEmpty()) {
339
			if(!collectionBotanique.getNbPlanchesHerbiers().isEmpty()) {
338
				planchesHerbier.setValue((Integer.parseInt(collectionBotanique.getNbPlanchesHerbiers())));
340
				planchesHerbier.setValue((Integer.parseInt(collectionBotanique.getNbPlanchesHerbiers())));
339
			}
341
			}
340
			
342
			
341
			if(!collectionBotanique.getNbEspeces().isEmpty()) {
343
			if(!collectionBotanique.getNbEspeces().isEmpty()) {
342
				nbEspeces.setValue((Integer.parseInt(collectionBotanique.getNbEspeces())));
344
				nbEspeces.setValue((Integer.parseInt(collectionBotanique.getNbEspeces())));
343
			}
345
			}
344
			
346
			
345
			typePapierConservationChp.peupler(collectionBotanique.getConservationPapierType());
347
			typePapierConservationChp.peupler(collectionBotanique.getConservationPapierType());
346
			methodeConservationChp.peupler(collectionBotanique.getConservationMethode());
348
			methodeConservationChp.peupler(collectionBotanique.getConservationMethode());
347
			
349
			
348
			specimenFixationPourcentChp.peupler(collectionBotanique.getSpecimenFixationPourcent());
350
			specimenFixationPourcentChp.peupler(collectionBotanique.getSpecimenFixationPourcent());
349
			etiquetteFixationPourcentChp.peupler(collectionBotanique.getEtiquetteFixationPourcent());
351
			etiquetteFixationPourcentChp.peupler(collectionBotanique.getEtiquetteFixationPourcent());
350
			specimentMethodeFixationChp.peupler(collectionBotanique.getSpecimenFixationMethode());
352
			specimentMethodeFixationChp.peupler(collectionBotanique.getSpecimenFixationMethode());
351
			etiquetteMethodeFixationSurSupportChp.peupler(collectionBotanique.getEtiquetteFixationSupport());
353
			etiquetteMethodeFixationSurSupportChp.peupler(collectionBotanique.getEtiquetteFixationSupport());
352
			etiquetteMethodeFixationSurSpecimenChp.peupler(collectionBotanique.getEtiquetteFixationSpecimen());
354
			etiquetteMethodeFixationSurSpecimenChp.peupler(collectionBotanique.getEtiquetteFixationSpecimen());
353
			typeEcritureChp.peupler(collectionBotanique.getEtiquetteEcriture());
355
			typeEcritureChp.peupler(collectionBotanique.getEtiquetteEcriture());
354
			
356
			
355
			traitementCombo.peupler(collectionBotanique.getTraitement());
357
			traitementCombo.peupler(collectionBotanique.getTraitement());
356
			poisonTraitementChp.peupler(collectionBotanique.getTraitementPoison());
358
			poisonTraitementChp.peupler(collectionBotanique.getTraitementPoison());
357
			insecteTraitementChp.peupler(collectionBotanique.getTraitementInsecte());
359
			insecteTraitementChp.peupler(collectionBotanique.getTraitementInsecte());
358
			
360
			
-
 
361
			remplirSimpleCombo(etatGeneralCombo, collectionBotanique.getEtatGeneral());
359
			etatGeneralCombo.peupler(collectionBotanique.getEtatGeneral());
362
			
360
			specimenDegradationChp.peupler(collectionBotanique.getDegradationSpecimen());
363
			specimenDegradationChp.peupler(collectionBotanique.getDegradationSpecimen());
361
			presentationDegradationChp.peupler(collectionBotanique.getDegradationPresentation());
364
			presentationDegradationChp.peupler(collectionBotanique.getDegradationPresentation());
362
			determinationCombo.peupler(collectionBotanique.getDetermination());
365
			determinationCombo.peupler(collectionBotanique.getDetermination());
363
		}		
366
		}		
364
	}
367
	}
365
	
368
	
366
	public void collecter() {
369
	public void collecter() {
367
		initialiserCollection();
370
		initialiserCollection();
368
		if (etreAccede()) {
371
		if (etreAccede()) {
369
			collectionBotaniqueCollectee.setType(typesCollectionBotaCombo.getValeur());
372
			collectionBotaniqueCollectee.setType(typesCollectionBotaCombo.getValeur());
370
			if (nbreEchantillonChp.getValue() != null) {
373
			if (nbreEchantillonChp.getValue() != null) {
371
				collectionBotaniqueCollectee.setNbreEchantillon(Integer.toString(nbreEchantillonChp.getValue().intValue()));
374
				collectionBotaniqueCollectee.setNbreEchantillon(Integer.toString(nbreEchantillonChp.getValue().intValue()));
372
			}
375
			}
373
			
376
			
374
			collectionBotaniqueCollectee.setNbCartonsHerbiers(nbCartonsHerbier.getValue()+"");
377
			collectionBotaniqueCollectee.setNbCartonsHerbiers(nbCartonsHerbier.getValue()+"");
375
			collectionBotaniqueCollectee.setFormatCartonsHerbiers(cartonsHerbierFormat.getValue());
378
			collectionBotaniqueCollectee.setFormatCartonsHerbiers(cartonsHerbierFormat.getValue());
376
			collectionBotaniqueCollectee.setNbLiasses(nbLiasses.getValue()+"");
379
			collectionBotaniqueCollectee.setNbLiasses(nbLiasses.getValue()+"");
377
			collectionBotaniqueCollectee.setFormatLiasses(liassesFormat.getValue());
380
			collectionBotaniqueCollectee.setFormatLiasses(liassesFormat.getValue());
378
			collectionBotaniqueCollectee.setAutresUnitesRangement(autresUnitesRangement.getValue());
381
			collectionBotaniqueCollectee.setAutresUnitesRangement(autresUnitesRangement.getValue());
379
			
382
			
380
			collectionBotaniqueCollectee.setUniteRangementEtat(etatUniteRangementCombo.getValeur());
383
			collectionBotaniqueCollectee.setUniteRangementEtat(etatUniteRangementCombo.getValue().getCle());
381
			
384
			
382
			collectionBotaniqueCollectee.setNbPlanchesHerbiers(planchesHerbier.getValue()+"");
385
			collectionBotaniqueCollectee.setNbPlanchesHerbiers(planchesHerbier.getValue()+"");
383
			collectionBotaniqueCollectee.setNbEspeces(nbEspeces.getValue()+"");
386
			collectionBotaniqueCollectee.setNbEspeces(nbEspeces.getValue()+"");
384
			
387
			
385
			collectionBotaniqueCollectee.setConservationPapierType(typePapierConservationChp.getValeur());
388
			collectionBotaniqueCollectee.setConservationPapierType(typePapierConservationChp.getValeur());
386
			collectionBotaniqueCollectee.setConservationMethode(methodeConservationChp.getValeur());
389
			collectionBotaniqueCollectee.setConservationMethode(methodeConservationChp.getValeur());
387
			
390
			
388
			collectionBotaniqueCollectee.setSpecimenFixationPourcent(specimenFixationPourcentChp.getValeur());
391
			collectionBotaniqueCollectee.setSpecimenFixationPourcent(specimenFixationPourcentChp.getValeur());
389
			collectionBotaniqueCollectee.setEtiquetteFixationPourcent(etiquetteFixationPourcentChp.getValeur());
392
			collectionBotaniqueCollectee.setEtiquetteFixationPourcent(etiquetteFixationPourcentChp.getValeur());
390
			collectionBotaniqueCollectee.setSpecimenFixationMethode(specimentMethodeFixationChp.getValeur());
393
			collectionBotaniqueCollectee.setSpecimenFixationMethode(specimentMethodeFixationChp.getValeur());
391
			collectionBotaniqueCollectee.setEtiquetteFixationSupport(etiquetteMethodeFixationSurSupportChp.getValeur());
394
			collectionBotaniqueCollectee.setEtiquetteFixationSupport(etiquetteMethodeFixationSurSupportChp.getValeur());
392
			collectionBotaniqueCollectee.setEtiquetteFixationSpecimen(etiquetteMethodeFixationSurSpecimenChp.getValeur());
395
			collectionBotaniqueCollectee.setEtiquetteFixationSpecimen(etiquetteMethodeFixationSurSpecimenChp.getValeur());
393
			collectionBotaniqueCollectee.setEtiquetteEcriture(typeEcritureChp.getValeur());
396
			collectionBotaniqueCollectee.setEtiquetteEcriture(typeEcritureChp.getValeur());
394
			
397
			
395
			collectionBotaniqueCollectee.setTraitement(traitementCombo.getValeur());
398
			collectionBotaniqueCollectee.setTraitement(traitementCombo.getValeur());
396
			collectionBotaniqueCollectee.setTraitementPoison(poisonTraitementChp.getValeur());
399
			collectionBotaniqueCollectee.setTraitementPoison(poisonTraitementChp.getValeur());
397
			collectionBotaniqueCollectee.setTraitementInsecte(insecteTraitementChp.getValeur());
400
			collectionBotaniqueCollectee.setTraitementInsecte(insecteTraitementChp.getValeur());
398
			
401
			
399
			collectionBotaniqueCollectee.setEtatGeneral(etatGeneralCombo.getValeur());
402
			collectionBotaniqueCollectee.setEtatGeneral(etatGeneralCombo.getValue().getCle());
400
			collectionBotaniqueCollectee.setDegradationSpecimen(specimenDegradationChp.getValeurs());
403
			collectionBotaniqueCollectee.setDegradationSpecimen(specimenDegradationChp.getValeurs());
401
			collectionBotaniqueCollectee.setDegradationPresentation(presentationDegradationChp.getValeurs());
404
			collectionBotaniqueCollectee.setDegradationPresentation(presentationDegradationChp.getValeurs());
402
			collectionBotaniqueCollectee.setDetermination(determinationCombo.getValeur());
405
			collectionBotaniqueCollectee.setDetermination(determinationCombo.getValeur());
403
		}
406
		}
404
	}
407
	}
405
 
408
 
406
	private void initialiserCollection() {
409
	private void initialiserCollection() {
407
		collection = ((CollectionForm) formulaire).collection;
410
		collection = ((CollectionForm) formulaire).collection;
408
		if (collection != null) {
411
		if (collection != null) {
409
			collectionBotanique = collection.getBotanique();
412
			collectionBotanique = collection.getBotanique();
410
		}
413
		}
411
		
414
		
412
		collectionCollectee = ((CollectionForm) formulaire).collectionCollectee;
415
		collectionCollectee = ((CollectionForm) formulaire).collectionCollectee;
413
		if (collectionCollectee != null) {
416
		if (collectionCollectee != null) {
414
			collectionBotaniqueCollectee = collectionCollectee.getBotanique();
417
			collectionBotaniqueCollectee = collectionCollectee.getBotanique();
415
		}
418
		}
416
	}
419
	}
-
 
420
	
-
 
421
	public void remplirSimpleCombo(ComboBox<SimpleModelData> simpleCombo, String valeur) {
-
 
422
		SimpleModelData selectionne = simpleCombo.getStore().findModel("cle", valeur);
-
 
423
		simpleCombo.setValue(selectionne);
-
 
424
	}
-
 
425
	
-
 
426
	public ComboBox<SimpleModelData> creerSimpleComboBonMauvaisEtat(String label) {
-
 
427
		ListStore<SimpleModelData> listeBonMauvaisEtat = OntologiesLocales.convertirVersListeStore(OntologiesLocales.getListeBonMauvaisEtat());
-
 
428
		ComboBox<SimpleModelData> combo = new ComboBox<SimpleModelData>();
-
 
429
		combo.setForceSelection(true);
-
 
430
		combo.setTriggerAction(TriggerAction.ALL);
-
 
431
		combo.setFieldLabel(label);
-
 
432
		combo.setDisplayField("valeur");
-
 
433
		combo.setValueField("cle");
-
 
434
		listeBonMauvaisEtat.sort("ordre", SortDir.ASC);
-
 
435
		combo.setStore(listeBonMauvaisEtat);
-
 
436
		return combo;
-
 
437
	}
417
	
438
	
418
	public void rafraichir(Object nouvellesDonnees) {
439
	public void rafraichir(Object nouvellesDonnees) {
419
		if (nouvellesDonnees instanceof ValeurListe) {
440
		if (nouvellesDonnees instanceof ValeurListe) {
420
			ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
441
			ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
421
			rafraichirValeurListe(listeValeurs);
442
			rafraichirValeurListe(listeValeurs);
422
		} else {
443
		} else {
423
			Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
444
			Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
424
		}
445
		}
425
	}
446
	}
426
	
447
	
427
	private void rafraichirValeurListe(ValeurListe listeValeurs) {
448
	private void rafraichirValeurListe(ValeurListe listeValeurs) {
428
		if (listeValeurs.getId().equals(config.getListeId("typeUniteRangement"))) {
449
		if (listeValeurs.getId().equals(config.getListeId("typeUniteRangement"))) {
429
			Iterator<String> it = listeValeurs.keySet().iterator();
450
			Iterator<String> it = listeValeurs.keySet().iterator();
430
			while (it.hasNext()) {
451
			while (it.hasNext()) {
431
				Valeur valeur = listeValeurs.get(it.next());
452
				Valeur valeur = listeValeurs.get(it.next());
432
				UniteRangement unite = new UniteRangement();
453
				UniteRangement unite = new UniteRangement();
433
				unite.setId(valeur.getId());
454
				unite.setId(valeur.getId());
434
				unite.setType(valeur.getNom());
455
				unite.setType(valeur.getNom());
435
				unite.setTypeAutre(false);
456
				unite.setTypeAutre(false);
436
				uniteRangementGrille.getStore().add(unite);
457
				uniteRangementGrille.getStore().add(unite);
437
			}
458
			}
438
		} else if (listeValeurs.getId().equals(config.getListeId("typeUniteBase"))) {
459
		} else if (listeValeurs.getId().equals(config.getListeId("typeUniteBase"))) {
439
			Iterator<String> it = listeValeurs.keySet().iterator();
460
			Iterator<String> it = listeValeurs.keySet().iterator();
440
			while (it.hasNext()) {
461
			while (it.hasNext()) {
441
				Valeur valeur = listeValeurs.get(it.next());
462
				Valeur valeur = listeValeurs.get(it.next());
442
				UniteBase unite = new UniteBase();
463
				UniteBase unite = new UniteBase();
443
				unite.setId(valeur.getId());
464
				unite.setId(valeur.getId());
444
				unite.setType(valeur.getNom());
465
				unite.setType(valeur.getNom());
445
				unite.setTypeAutre(false);
466
				unite.setTypeAutre(false);
446
				uniteBaseGrille.getStore().add(unite);
467
				uniteBaseGrille.getStore().add(unite);
447
			}
468
			}
448
		} else {
469
		} else {
449
			Debug.log("Gestion de la liste "+listeValeurs.getId()+" non implémenté!");
470
			Debug.log("Gestion de la liste "+listeValeurs.getId()+" non implémenté!");
450
		}
471
		}
451
	}
472
	}
452
}
473
}