Subversion Repositories eFlore/Applications.coel

Rev

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

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