934 |
jpm |
1 |
package org.tela_botanica.client.vues.collection;
|
806 |
jpm |
2 |
|
|
|
3 |
import java.util.ArrayList;
|
948 |
jpm |
4 |
import java.util.HashMap;
|
806 |
jpm |
5 |
import java.util.Iterator;
|
|
|
6 |
import java.util.List;
|
|
|
7 |
|
|
|
8 |
import org.tela_botanica.client.Mediateur;
|
839 |
jpm |
9 |
import org.tela_botanica.client.composants.ChampCaseACocher;
|
854 |
jpm |
10 |
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
|
857 |
jpm |
11 |
import org.tela_botanica.client.composants.ChampMultiValeursMultiTypes;
|
858 |
jpm |
12 |
import org.tela_botanica.client.composants.ChampSliderPourcentage;
|
806 |
jpm |
13 |
import org.tela_botanica.client.images.Images;
|
|
|
14 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
831 |
jpm |
15 |
import org.tela_botanica.client.modeles.InterneValeur;
|
|
|
16 |
import org.tela_botanica.client.modeles.UniteBase;
|
806 |
jpm |
17 |
import org.tela_botanica.client.modeles.UniteRangement;
|
|
|
18 |
import org.tela_botanica.client.modeles.Valeur;
|
|
|
19 |
import org.tela_botanica.client.modeles.ValeurListe;
|
948 |
jpm |
20 |
import org.tela_botanica.client.modeles.aDonnee;
|
|
|
21 |
import org.tela_botanica.client.modeles.collection.Collection;
|
|
|
22 |
import org.tela_botanica.client.modeles.collection.CollectionAPersonne;
|
|
|
23 |
import org.tela_botanica.client.modeles.collection.CollectionBotanique;
|
|
|
24 |
import org.tela_botanica.client.util.Debug;
|
|
|
25 |
import org.tela_botanica.client.util.Pattern;
|
|
|
26 |
import org.tela_botanica.client.util.UtilNombre;
|
|
|
27 |
import org.tela_botanica.client.util.UtilString;
|
934 |
jpm |
28 |
import org.tela_botanica.client.vues.Formulaire;
|
|
|
29 |
import org.tela_botanica.client.vues.FormulaireOnglet;
|
806 |
jpm |
30 |
|
859 |
jpm |
31 |
import com.extjs.gxt.ui.client.Style.Scroll;
|
831 |
jpm |
32 |
import com.extjs.gxt.ui.client.event.ButtonEvent;
|
806 |
jpm |
33 |
import com.extjs.gxt.ui.client.event.Listener;
|
831 |
jpm |
34 |
import com.extjs.gxt.ui.client.event.MessageBoxEvent;
|
|
|
35 |
import com.extjs.gxt.ui.client.event.SelectionListener;
|
806 |
jpm |
36 |
import com.extjs.gxt.ui.client.store.ListStore;
|
|
|
37 |
import com.extjs.gxt.ui.client.widget.ContentPanel;
|
831 |
jpm |
38 |
import com.extjs.gxt.ui.client.widget.Info;
|
|
|
39 |
import com.extjs.gxt.ui.client.widget.MessageBox;
|
839 |
jpm |
40 |
import com.extjs.gxt.ui.client.widget.Text;
|
831 |
jpm |
41 |
import com.extjs.gxt.ui.client.widget.button.Button;
|
|
|
42 |
import com.extjs.gxt.ui.client.widget.form.ComboBox;
|
862 |
jpm |
43 |
import com.extjs.gxt.ui.client.widget.form.FieldSet;
|
831 |
jpm |
44 |
import com.extjs.gxt.ui.client.widget.form.NumberField;
|
|
|
45 |
import com.extjs.gxt.ui.client.widget.form.TextField;
|
|
|
46 |
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
|
|
|
47 |
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
|
|
|
48 |
import com.extjs.gxt.ui.client.widget.grid.AggregationRowConfig;
|
|
|
49 |
import com.extjs.gxt.ui.client.widget.grid.CellEditor;
|
806 |
jpm |
50 |
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
|
948 |
jpm |
51 |
import com.extjs.gxt.ui.client.widget.grid.ColumnData;
|
806 |
jpm |
52 |
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
|
831 |
jpm |
53 |
import com.extjs.gxt.ui.client.widget.grid.EditorGrid;
|
806 |
jpm |
54 |
import com.extjs.gxt.ui.client.widget.grid.Grid;
|
948 |
jpm |
55 |
import com.extjs.gxt.ui.client.widget.grid.GridCellRenderer;
|
806 |
jpm |
56 |
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
|
831 |
jpm |
57 |
import com.extjs.gxt.ui.client.widget.grid.HeaderGroupConfig;
|
|
|
58 |
import com.extjs.gxt.ui.client.widget.grid.SummaryType;
|
806 |
jpm |
59 |
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
831 |
jpm |
60 |
import com.extjs.gxt.ui.client.widget.layout.FormData;
|
|
|
61 |
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
|
|
|
62 |
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
|
|
|
63 |
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
806 |
jpm |
64 |
import com.google.gwt.core.client.GWT;
|
831 |
jpm |
65 |
import com.google.gwt.i18n.client.NumberFormat;
|
806 |
jpm |
66 |
|
|
|
67 |
public class CollectionFormDescription extends FormulaireOnglet implements Rafraichissable {
|
|
|
68 |
|
948 |
jpm |
69 |
private Collection collection = null;
|
|
|
70 |
private CollectionBotanique collectionBotanique = null;
|
|
|
71 |
private Collection collectionCollectee = null;
|
|
|
72 |
private CollectionBotanique collectionBotaniqueCollectee = null;
|
|
|
73 |
|
858 |
jpm |
74 |
private ChampComboBoxListeValeurs typesCollectionBotaCombo = null;
|
|
|
75 |
private NumberField nbreEchantillonChp = null;
|
948 |
jpm |
76 |
private EditorGrid<UniteRangement> uniteRangementGrille = null;
|
854 |
jpm |
77 |
private ChampComboBoxListeValeurs etatUniteRangementCombo = null;
|
948 |
jpm |
78 |
private EditorGrid<UniteBase> uniteBaseGrille = null;
|
839 |
jpm |
79 |
private ChampCaseACocher typePapierConservationChp = null;
|
|
|
80 |
private ChampCaseACocher methodeConservationChp = null;
|
858 |
jpm |
81 |
private ChampSliderPourcentage specimenFixationPourcentChp = null;
|
|
|
82 |
private ChampSliderPourcentage etiquetteFixationPourcentChp = null;
|
854 |
jpm |
83 |
private ChampCaseACocher specimentMethodeFixationChp = null;
|
|
|
84 |
private ChampCaseACocher etiquetteMethodeFixationSurSupportChp = null;
|
|
|
85 |
private ChampCaseACocher etiquetteMethodeFixationSurSpecimenChp = null;
|
|
|
86 |
private ChampCaseACocher typeEcritureChp = null;
|
|
|
87 |
private ChampComboBoxListeValeurs traitementCombo = null;
|
|
|
88 |
private ChampCaseACocher poisonTraitementChp = null;
|
|
|
89 |
private ChampCaseACocher insecteTraitementChp = null;
|
|
|
90 |
private ChampComboBoxListeValeurs etatGeneralCombo = null;
|
|
|
91 |
private ChampComboBoxListeValeurs determinationCombo = null;
|
857 |
jpm |
92 |
private ChampMultiValeursMultiTypes specimenDegradationChp = null;
|
|
|
93 |
private ChampMultiValeursMultiTypes presentationDegradationChp = null;
|
948 |
jpm |
94 |
private ComboBox<InterneValeur> precisionCombo;
|
831 |
jpm |
95 |
|
806 |
jpm |
96 |
public CollectionFormDescription(Formulaire formulaireCourrant) {
|
|
|
97 |
initialiserOnglet(formulaireCourrant);
|
|
|
98 |
setId("description");
|
|
|
99 |
setText(Mediateur.i18nC.collectionDescription());
|
831 |
jpm |
100 |
|
|
|
101 |
FormLayout formulaireLayout = (FormLayout) this.getLayout();
|
|
|
102 |
formulaireLayout.setLabelAlign(LabelAlign.LEFT);
|
|
|
103 |
formulaireLayout.setLabelWidth(300);
|
806 |
jpm |
104 |
|
862 |
jpm |
105 |
creerFieldsetPrecision();
|
|
|
106 |
creerUniteRangement();
|
|
|
107 |
creerUniteBase();
|
|
|
108 |
creerFieldsetConservation();
|
|
|
109 |
creerFieldsetEtiquette();
|
|
|
110 |
creerFieldsetTraitement();
|
|
|
111 |
creerFieldsetEtat();
|
|
|
112 |
|
|
|
113 |
layout();
|
|
|
114 |
}
|
|
|
115 |
|
|
|
116 |
private void creerFieldsetPrecision() {
|
|
|
117 |
FieldSet precisionFieldSet = new FieldSet();
|
|
|
118 |
precisionFieldSet.setHeading("Précision");
|
|
|
119 |
precisionFieldSet.setCollapsible(true);
|
|
|
120 |
precisionFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
|
|
121 |
|
858 |
jpm |
122 |
typesCollectionBotaCombo = new ChampComboBoxListeValeurs(i18nC.typeCollectionBotanique(), "typeCollectionBota");
|
|
|
123 |
typesCollectionBotaCombo.setTabIndex(tabIndex++);
|
862 |
jpm |
124 |
precisionFieldSet.add(typesCollectionBotaCombo, new FormData(250, 0));
|
858 |
jpm |
125 |
|
|
|
126 |
nbreEchantillonChp = new NumberField();
|
|
|
127 |
nbreEchantillonChp.setFieldLabel(i18nC.nbreEchantillon());
|
|
|
128 |
nbreEchantillonChp.setToolTip(i18nC.nbreEchantillonInfo());
|
|
|
129 |
nbreEchantillonChp.setFormat(NumberFormat.getFormat("#"));
|
862 |
jpm |
130 |
precisionFieldSet.add(nbreEchantillonChp);
|
858 |
jpm |
131 |
|
862 |
jpm |
132 |
this.add(precisionFieldSet);
|
806 |
jpm |
133 |
}
|
|
|
134 |
|
831 |
jpm |
135 |
private void creerUniteRangement() {
|
|
|
136 |
ContentPanel panneauGrille = creerPanneauContenantGrille(i18nC.collectionUniteRangementTitre());
|
862 |
jpm |
137 |
|
831 |
jpm |
138 |
uniteRangementGrille = creerGrilleUniteRangement();
|
858 |
jpm |
139 |
mediateur.obtenirListeValeurEtRafraichir(this, "typeUniteRangement");
|
806 |
jpm |
140 |
panneauGrille.add(uniteRangementGrille);
|
862 |
jpm |
141 |
|
831 |
jpm |
142 |
ToolBar barreOutils = creerBarreOutilsGrilleUniteRangement();
|
|
|
143 |
panneauGrille.setTopComponent(barreOutils);
|
862 |
jpm |
144 |
|
806 |
jpm |
145 |
add(panneauGrille);
|
|
|
146 |
}
|
831 |
jpm |
147 |
|
|
|
148 |
private ContentPanel creerPanneauContenantGrille(String titre) {
|
806 |
jpm |
149 |
ContentPanel panneau = new ContentPanel();
|
831 |
jpm |
150 |
panneau.setHeading(titre);
|
806 |
jpm |
151 |
panneau.setIcon(Images.ICONES.table());
|
|
|
152 |
panneau.setLayout(new FitLayout());
|
|
|
153 |
panneau.setFrame(true);
|
859 |
jpm |
154 |
panneau.setScrollMode(Scroll.AUTO);
|
862 |
jpm |
155 |
panneau.setCollapsible(true);
|
|
|
156 |
panneau.setStyleAttribute("margin", "5px 0");
|
806 |
jpm |
157 |
|
|
|
158 |
return panneau;
|
|
|
159 |
}
|
|
|
160 |
|
948 |
jpm |
161 |
private EditorGrid<UniteRangement> creerGrilleUniteRangement() {
|
806 |
jpm |
162 |
ListStore<UniteRangement> storeGrille = new ListStore<UniteRangement>();
|
|
|
163 |
|
|
|
164 |
List<ColumnConfig> colonnes = new ArrayList<ColumnConfig>();
|
831 |
jpm |
165 |
colonnes.add(new ColumnConfig("type", i18nC.collectionUniteType(), 150));
|
806 |
jpm |
166 |
|
831 |
jpm |
167 |
NumberField champNombre = new NumberField();
|
|
|
168 |
champNombre.setFormat(NumberFormat.getFormat("#"));
|
|
|
169 |
|
|
|
170 |
ColumnConfig nombreColonne = new ColumnConfig("nombre", i18nC.collectionUniteNbre(), 50);
|
948 |
jpm |
171 |
nombreColonne.setEditor(new CellEditor(champNombre));
|
|
|
172 |
nombreColonne.setNumberFormat(NumberFormat.getFormat("#"));
|
831 |
jpm |
173 |
colonnes.add(nombreColonne);
|
|
|
174 |
|
|
|
175 |
ListStore<InterneValeur> precisionStore = new ListStore<InterneValeur>();
|
|
|
176 |
precisionStore.add(new InterneValeur(UniteRangement.COMPTE_APPROXIMATIF, i18nC.precisionApproximatif()));
|
|
|
177 |
precisionStore.add(new InterneValeur(UniteRangement.COMPTE_EXACT, i18nC.precisionExact()));
|
|
|
178 |
|
948 |
jpm |
179 |
precisionCombo = new ComboBox<InterneValeur>();
|
831 |
jpm |
180 |
precisionCombo.setForceSelection(true);
|
|
|
181 |
precisionCombo.setTriggerAction(TriggerAction.ALL);
|
|
|
182 |
precisionCombo.setDisplayField("nom");
|
|
|
183 |
precisionCombo.setStore(precisionStore);
|
|
|
184 |
precisionCombo.setEditable(false);
|
|
|
185 |
|
|
|
186 |
CellEditor editeurPrecision = new CellEditor(precisionCombo) {
|
|
|
187 |
@Override
|
|
|
188 |
public Object preProcessValue(Object valeur) {
|
|
|
189 |
InterneValeur retour = null;
|
|
|
190 |
if (valeur != null ) {
|
|
|
191 |
if (precisionCombo.getStore().findModel("nom", valeur.toString()) != null) {
|
|
|
192 |
retour = precisionCombo.getStore().findModel("nom", valeur.toString());
|
|
|
193 |
} else if (precisionCombo.getStore().findModel("abr", valeur.toString()) != null) {
|
|
|
194 |
retour = precisionCombo.getStore().findModel("abr", valeur.toString());
|
|
|
195 |
}
|
|
|
196 |
}
|
|
|
197 |
return retour;
|
|
|
198 |
}
|
|
|
199 |
|
|
|
200 |
@Override
|
|
|
201 |
public Object postProcessValue(Object valeur) {
|
|
|
202 |
String retour = null;
|
|
|
203 |
if (valeur != null ) {
|
|
|
204 |
if (valeur instanceof InterneValeur) {
|
|
|
205 |
InterneValeur valeurInterne = (InterneValeur) valeur;
|
|
|
206 |
retour = valeurInterne.getNom();
|
|
|
207 |
}
|
|
|
208 |
}
|
|
|
209 |
return retour;
|
948 |
jpm |
210 |
}
|
831 |
jpm |
211 |
};
|
|
|
212 |
|
|
|
213 |
ColumnConfig precisionColonne = new ColumnConfig("precision", i18nC.collectionUnitePrecision(), 50);
|
|
|
214 |
precisionColonne.setEditor(editeurPrecision);
|
|
|
215 |
colonnes.add(precisionColonne);
|
|
|
216 |
|
|
|
217 |
TextField<String> formatChp = new TextField<String>();
|
|
|
218 |
formatChp.setAllowBlank(false);
|
|
|
219 |
|
|
|
220 |
ColumnConfig formatColonne = new ColumnConfig("format", i18nC.collectionUniteFormat(), 100);
|
|
|
221 |
formatColonne.setEditor(new CellEditor(formatChp));
|
|
|
222 |
colonnes.add(formatColonne);
|
|
|
223 |
|
806 |
jpm |
224 |
GridSelectionModel<UniteRangement> modeleDeSelection = new GridSelectionModel<UniteRangement>();
|
|
|
225 |
ColumnModel modeleDeColonnes = new ColumnModel(colonnes);
|
|
|
226 |
|
948 |
jpm |
227 |
AggregationRowConfig<UniteBase> total = new AggregationRowConfig<UniteBase>();
|
|
|
228 |
total.setHtml("type", "TOTAL");
|
|
|
229 |
total.setSummaryType("nombre", SummaryType.SUM);
|
|
|
230 |
total.setSummaryFormat("nombre", NumberFormat.getFormat("#"));
|
|
|
231 |
modeleDeColonnes.addAggregationRow(total);
|
|
|
232 |
|
831 |
jpm |
233 |
EditorGrid<UniteRangement> grilleUniteRangement = new EditorGrid<UniteRangement>(storeGrille, modeleDeColonnes);
|
806 |
jpm |
234 |
grilleUniteRangement.setHeight(300);
|
|
|
235 |
grilleUniteRangement.setBorders(true);
|
|
|
236 |
grilleUniteRangement.setSelectionModel(modeleDeSelection);
|
|
|
237 |
grilleUniteRangement.getView().setForceFit(true);
|
|
|
238 |
grilleUniteRangement.getView().setAutoFill(true);
|
|
|
239 |
grilleUniteRangement.setAutoExpandColumn("type");
|
|
|
240 |
grilleUniteRangement.setStripeRows(true);
|
|
|
241 |
grilleUniteRangement.setTrackMouseOver(true);
|
|
|
242 |
|
|
|
243 |
return grilleUniteRangement;
|
|
|
244 |
}
|
|
|
245 |
|
948 |
jpm |
246 |
private String collecterGrilleUniteRangement() {
|
|
|
247 |
String truk = "";
|
|
|
248 |
int nbreUnite = uniteRangementGrille.getStore().getCount();
|
|
|
249 |
for (int i = 0; i < nbreUnite; i++) {
|
|
|
250 |
UniteRangement unite = uniteRangementGrille.getStore().getAt(i);
|
|
|
251 |
truk += unite.getId()+aDonnee.SEPARATEUR_TYPE_VALEUR;
|
|
|
252 |
truk += UtilNombre.formaterEnEntier(unite.getNombre())+aDonnee.SEPARATEUR_DONNEES;
|
|
|
253 |
String precision = "";
|
|
|
254 |
InterneValeur precisionValeur = precisionCombo.getStore().findModel("nom", unite.getPrecision());
|
|
|
255 |
if (precisionValeur != null) {
|
|
|
256 |
precision = precisionValeur.getAbr();
|
|
|
257 |
}
|
|
|
258 |
truk += precision+aDonnee.SEPARATEUR_DONNEES;
|
|
|
259 |
truk += unite.getFormat();
|
|
|
260 |
truk += (i == (nbreUnite - 1)) ? "" : aDonnee.SEPARATEUR_VALEURS;
|
|
|
261 |
}
|
|
|
262 |
return truk;
|
|
|
263 |
}
|
|
|
264 |
|
|
|
265 |
private void peuplerGrilleUniteRangement(String valeurTruk) {
|
|
|
266 |
if (!UtilString.isEmpty(valeurTruk)) {
|
|
|
267 |
HashMap<String,UniteRangement> unitesEnregistrees = new HashMap<String,UniteRangement>();
|
|
|
268 |
String[] unites = valeurTruk.split(Pattern.quote(aDonnee.SEPARATEUR_VALEURS));
|
|
|
269 |
for (int i = 0; i < unites.length; i++) {
|
|
|
270 |
String[] uniteTypeIdDonnees = unites[i].split(Pattern.quote(aDonnee.SEPARATEUR_TYPE_VALEUR));
|
|
|
271 |
String uniteChaineDonnees = uniteTypeIdDonnees[1];
|
|
|
272 |
String[] uniteDonnees = uniteChaineDonnees.split(Pattern.quote(aDonnee.SEPARATEUR_DONNEES));
|
|
|
273 |
|
|
|
274 |
UniteRangement uniteRangement = new UniteRangement();
|
|
|
275 |
uniteRangement.setId(uniteTypeIdDonnees[0]);
|
|
|
276 |
if (uniteDonnees.length > 0) {
|
|
|
277 |
uniteRangement.setNombre(UtilString.formaterEnDouble(uniteDonnees[0]));
|
|
|
278 |
}
|
|
|
279 |
if (uniteDonnees.length > 1) {
|
|
|
280 |
uniteRangement.setPrecision(uniteDonnees[1]);
|
|
|
281 |
}
|
|
|
282 |
if (uniteDonnees.length > 2) {
|
|
|
283 |
uniteRangement.setFormat(uniteDonnees[2]);
|
|
|
284 |
Debug.log(uniteTypeIdDonnees[0]+"/"+uniteTypeIdDonnees[1]+"/"+uniteDonnees[0]+"-"+uniteDonnees[1]+"-"+uniteDonnees[2]);
|
|
|
285 |
}
|
|
|
286 |
unitesEnregistrees.put(uniteTypeIdDonnees[0], uniteRangement);
|
|
|
287 |
}
|
|
|
288 |
|
|
|
289 |
ArrayList<UniteRangement> listeUniteMaj = new ArrayList<UniteRangement>();
|
|
|
290 |
int nbreUnite = uniteRangementGrille.getStore().getCount();
|
|
|
291 |
for (int i = 0; i < nbreUnite; i++) {
|
|
|
292 |
UniteRangement uniteDansGrille = uniteRangementGrille.getStore().getAt(i);
|
|
|
293 |
UniteRangement uniteEnregistree = unitesEnregistrees.get(uniteDansGrille.getId());
|
|
|
294 |
if (uniteEnregistree != null) {
|
|
|
295 |
listeUniteMaj.add(uniteEnregistree);
|
|
|
296 |
} else {
|
|
|
297 |
listeUniteMaj.add(uniteDansGrille);
|
|
|
298 |
}
|
|
|
299 |
}
|
|
|
300 |
uniteRangementGrille.getStore().removeAll();
|
|
|
301 |
uniteRangementGrille.getStore().add(listeUniteMaj);
|
|
|
302 |
layout();
|
|
|
303 |
}
|
|
|
304 |
}
|
|
|
305 |
|
831 |
jpm |
306 |
private ToolBar creerBarreOutilsGrilleUniteRangement() {
|
|
|
307 |
ToolBar barreOutils = new ToolBar();
|
|
|
308 |
|
|
|
309 |
Button ajouterBouton = creerBoutonAjouterUniteRangement();
|
|
|
310 |
barreOutils.add(ajouterBouton);
|
|
|
311 |
|
|
|
312 |
barreOutils.add(new SeparatorToolItem());
|
|
|
313 |
|
|
|
314 |
Button supprimerBouton = creerBoutonSupprimerUniteRangement();
|
862 |
jpm |
315 |
barreOutils.add(supprimerBouton);
|
831 |
jpm |
316 |
|
862 |
jpm |
317 |
barreOutils.add(new SeparatorToolItem());
|
|
|
318 |
barreOutils.add(new Text(i18nC.collectionUniteRangementEtatGeneralLabel()));
|
|
|
319 |
etatUniteRangementCombo = new ChampComboBoxListeValeurs("", "etat");
|
|
|
320 |
etatUniteRangementCombo.setEmptyText(i18nC.collectionUniteRangementEtatGeneral());
|
|
|
321 |
etatUniteRangementCombo.setToolTip(i18nC.collectionUniteRangementEtatGeneralInfo());
|
|
|
322 |
etatUniteRangementCombo.setTrie("id_valeur");
|
|
|
323 |
etatUniteRangementCombo.setWidth(300);
|
|
|
324 |
barreOutils.add(etatUniteRangementCombo);
|
|
|
325 |
|
831 |
jpm |
326 |
return barreOutils;
|
|
|
327 |
}
|
|
|
328 |
|
|
|
329 |
private Button creerBoutonAjouterUniteRangement() {
|
|
|
330 |
Button bouton = new Button(i18nC.ajouter());
|
|
|
331 |
bouton.setIcon(Images.ICONES.ajouter());
|
|
|
332 |
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
|
333 |
@Override
|
|
|
334 |
public void componentSelected(ButtonEvent ce) {
|
|
|
335 |
final MessageBox box = MessageBox.prompt(i18nC.collectionUniteType(), i18nC.collectionUniteRangementSaisirType());
|
|
|
336 |
box.addCallback(new Listener<MessageBoxEvent>() {
|
|
|
337 |
public void handleEvent(MessageBoxEvent be) {
|
|
|
338 |
final UniteRangement unite = new UniteRangement();
|
|
|
339 |
unite.setType(be.getValue());
|
|
|
340 |
unite.setTypeAutre(true);
|
|
|
341 |
uniteRangementGrille.getStore().add(unite);
|
|
|
342 |
}
|
|
|
343 |
});
|
|
|
344 |
}
|
|
|
345 |
});
|
|
|
346 |
return bouton;
|
|
|
347 |
}
|
|
|
348 |
|
|
|
349 |
private Button creerBoutonSupprimerUniteRangement() {
|
|
|
350 |
Button bouton = new Button(i18nC.supprimer());
|
|
|
351 |
bouton.setIcon(Images.ICONES.supprimer());
|
|
|
352 |
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
|
353 |
@Override
|
|
|
354 |
public void componentSelected(ButtonEvent ce) {
|
|
|
355 |
UniteRangement uniteRangementSelectionnee = uniteRangementGrille.getSelectionModel().getSelectedItem();
|
|
|
356 |
if (uniteRangementSelectionnee == null) {
|
|
|
357 |
Info.display(i18nC.informationTitreGenerique(), Mediateur.i18nM.veuillezSelectionner(i18nC.selectionnerUniteRangement()));
|
|
|
358 |
} else if (uniteRangementSelectionnee.getTypeAutre() == false) {
|
|
|
359 |
Info.display(i18nC.informationTitreGenerique(), i18nC.selectionnerUniteRangementAjoute());
|
|
|
360 |
} else {
|
|
|
361 |
uniteRangementGrille.getStore().remove(uniteRangementSelectionnee);
|
|
|
362 |
}
|
|
|
363 |
}
|
|
|
364 |
});
|
|
|
365 |
return bouton;
|
|
|
366 |
}
|
|
|
367 |
|
|
|
368 |
private void creerUniteBase() {
|
|
|
369 |
ContentPanel panneauGrille = creerPanneauContenantGrille(i18nC.collectionUniteBaseTitre());
|
862 |
jpm |
370 |
|
831 |
jpm |
371 |
uniteBaseGrille = creerGrilleUniteBase();
|
858 |
jpm |
372 |
mediateur.obtenirListeValeurEtRafraichir(this, "typeUniteBase");
|
831 |
jpm |
373 |
panneauGrille.add(uniteBaseGrille);
|
862 |
jpm |
374 |
|
831 |
jpm |
375 |
ToolBar barreOutils = creerBarreOutilsGrilleUniteBase();
|
|
|
376 |
panneauGrille.setTopComponent(barreOutils);
|
862 |
jpm |
377 |
|
831 |
jpm |
378 |
add(panneauGrille);
|
|
|
379 |
}
|
|
|
380 |
|
948 |
jpm |
381 |
private EditorGrid<UniteBase> creerGrilleUniteBase() {
|
831 |
jpm |
382 |
ListStore<UniteBase> storeGrille = new ListStore<UniteBase>();
|
|
|
383 |
|
|
|
384 |
List<ColumnConfig> colonnes = new ArrayList<ColumnConfig>();
|
|
|
385 |
colonnes.add(new ColumnConfig("type", i18nC.collectionUniteType(), 150));
|
|
|
386 |
|
|
|
387 |
NumberField champNombre = new NumberField();
|
|
|
388 |
champNombre.setFormat(NumberFormat.getFormat("#"));
|
|
|
389 |
CellEditor editeurNombre = new CellEditor(champNombre);
|
|
|
390 |
|
|
|
391 |
ColumnConfig nombreColonne = new ColumnConfig("nombre", i18nC.collectionUniteNbre(), 50);
|
|
|
392 |
nombreColonne.setEditor(editeurNombre);
|
948 |
jpm |
393 |
nombreColonne.setNumberFormat(NumberFormat.getFormat("#"));
|
831 |
jpm |
394 |
colonnes.add(nombreColonne);
|
|
|
395 |
|
|
|
396 |
ListStore<InterneValeur> precisionStore = new ListStore<InterneValeur>();
|
|
|
397 |
precisionStore.add(new InterneValeur(UniteRangement.COMPTE_APPROXIMATIF, i18nC.precisionApproximatif()));
|
|
|
398 |
precisionStore.add(new InterneValeur(UniteRangement.COMPTE_EXACT, i18nC.precisionExact()));
|
|
|
399 |
|
|
|
400 |
final ComboBox<InterneValeur> precisionCombo = new ComboBox<InterneValeur>();
|
|
|
401 |
precisionCombo.setForceSelection(true);
|
|
|
402 |
precisionCombo.setTriggerAction(TriggerAction.ALL);
|
|
|
403 |
precisionCombo.setDisplayField("nom");
|
|
|
404 |
precisionCombo.setStore(precisionStore);
|
|
|
405 |
precisionCombo.setEditable(false);
|
|
|
406 |
|
|
|
407 |
CellEditor editeurPrecision = new CellEditor(precisionCombo) {
|
|
|
408 |
@Override
|
|
|
409 |
public Object preProcessValue(Object valeur) {
|
|
|
410 |
InterneValeur retour = null;
|
|
|
411 |
if (valeur != null ) {
|
|
|
412 |
if (precisionCombo.getStore().findModel("nom", valeur.toString()) != null) {
|
|
|
413 |
retour = precisionCombo.getStore().findModel("nom", valeur.toString());
|
|
|
414 |
} else if (precisionCombo.getStore().findModel("abr", valeur.toString()) != null) {
|
|
|
415 |
retour = precisionCombo.getStore().findModel("abr", valeur.toString());
|
|
|
416 |
}
|
|
|
417 |
}
|
|
|
418 |
return retour;
|
|
|
419 |
}
|
|
|
420 |
|
|
|
421 |
@Override
|
|
|
422 |
public Object postProcessValue(Object valeur) {
|
|
|
423 |
String retour = null;
|
|
|
424 |
if (valeur != null ) {
|
|
|
425 |
if (valeur instanceof InterneValeur) {
|
|
|
426 |
InterneValeur valeurInterne = (InterneValeur) valeur;
|
|
|
427 |
retour = valeurInterne.getNom();
|
|
|
428 |
}
|
|
|
429 |
}
|
|
|
430 |
return retour;
|
|
|
431 |
}
|
|
|
432 |
};
|
|
|
433 |
|
|
|
434 |
ColumnConfig precisionColonne = new ColumnConfig("precision", i18nC.collectionUnitePrecision(), 50);
|
|
|
435 |
precisionColonne.setEditor(editeurPrecision);
|
|
|
436 |
colonnes.add(precisionColonne);
|
|
|
437 |
|
|
|
438 |
TextField<String> formatChp = new TextField<String>();
|
|
|
439 |
formatChp.setAllowBlank(false);
|
|
|
440 |
|
|
|
441 |
ColumnConfig formatColonne = new ColumnConfig("format", i18nC.collectionUniteFormat(), 100);
|
|
|
442 |
formatColonne.setEditor(new CellEditor(formatChp));
|
|
|
443 |
colonnes.add(formatColonne);
|
|
|
444 |
|
|
|
445 |
ColumnConfig partNombreColonne = new ColumnConfig("nombre_part", i18nC.collectionUniteNbre(), 50);
|
|
|
446 |
partNombreColonne.setEditor(editeurNombre);
|
948 |
jpm |
447 |
partNombreColonne.setNumberFormat(NumberFormat.getFormat("#"));
|
831 |
jpm |
448 |
colonnes.add(partNombreColonne);
|
|
|
449 |
|
|
|
450 |
ColumnConfig partPrecisionColonne = new ColumnConfig("precision_part", i18nC.collectionUnitePrecision(), 50);
|
|
|
451 |
partPrecisionColonne.setEditor(editeurPrecision);
|
|
|
452 |
colonnes.add(partPrecisionColonne);
|
|
|
453 |
|
|
|
454 |
ColumnConfig spNombreColonne = new ColumnConfig("nombre_sp", i18nC.collectionUniteNbre(), 50);
|
|
|
455 |
spNombreColonne.setEditor(editeurNombre);
|
948 |
jpm |
456 |
spNombreColonne.setNumberFormat(NumberFormat.getFormat("#"));
|
831 |
jpm |
457 |
colonnes.add(spNombreColonne);
|
|
|
458 |
|
|
|
459 |
ColumnConfig spPrecisionColonne = new ColumnConfig("precision_sp", i18nC.collectionUnitePrecision(), 50);
|
|
|
460 |
spPrecisionColonne.setEditor(editeurPrecision);
|
|
|
461 |
colonnes.add(spPrecisionColonne);
|
|
|
462 |
|
|
|
463 |
GridSelectionModel<UniteBase> modeleDeSelection = new GridSelectionModel<UniteBase>();
|
|
|
464 |
ColumnModel modeleDeColonnes = new ColumnModel(colonnes);
|
|
|
465 |
modeleDeColonnes.addHeaderGroup(0, 0, new HeaderGroupConfig(i18nC.collectionUniteBase(), 1, 4));
|
|
|
466 |
modeleDeColonnes.addHeaderGroup(0, 4, new HeaderGroupConfig(i18nC.collectionUniteBasePart(), 1, 2));
|
|
|
467 |
modeleDeColonnes.addHeaderGroup(0, 6, new HeaderGroupConfig(i18nC.collectionUniteBaseSp(), 1, 2));
|
|
|
468 |
|
|
|
469 |
AggregationRowConfig<UniteBase> total = new AggregationRowConfig<UniteBase>();
|
|
|
470 |
total.setHtml("type", "TOTAL");
|
|
|
471 |
total.setSummaryType("nombre", SummaryType.SUM);
|
|
|
472 |
total.setSummaryFormat("nombre", NumberFormat.getFormat("#"));
|
|
|
473 |
total.setSummaryType("nombre_part", SummaryType.SUM);
|
|
|
474 |
total.setSummaryFormat("nombre_part", NumberFormat.getFormat("#"));
|
|
|
475 |
total.setSummaryType("nombre_sp", SummaryType.SUM);
|
|
|
476 |
total.setSummaryFormat("nombre_sp", NumberFormat.getFormat("#"));
|
|
|
477 |
modeleDeColonnes.addAggregationRow(total);
|
|
|
478 |
|
|
|
479 |
EditorGrid<UniteBase> grilleUniteBase = new EditorGrid<UniteBase>(storeGrille, modeleDeColonnes);
|
|
|
480 |
grilleUniteBase.setHeight(200);
|
|
|
481 |
grilleUniteBase.setBorders(true);
|
|
|
482 |
grilleUniteBase.setSelectionModel(modeleDeSelection);
|
|
|
483 |
grilleUniteBase.getView().setForceFit(true);
|
|
|
484 |
grilleUniteBase.getView().setAutoFill(true);
|
|
|
485 |
grilleUniteBase.setAutoExpandColumn("type");
|
|
|
486 |
grilleUniteBase.setStripeRows(true);
|
|
|
487 |
grilleUniteBase.setTrackMouseOver(true);
|
|
|
488 |
|
|
|
489 |
return grilleUniteBase;
|
|
|
490 |
}
|
|
|
491 |
|
|
|
492 |
private ToolBar creerBarreOutilsGrilleUniteBase() {
|
|
|
493 |
ToolBar barreOutils = new ToolBar();
|
|
|
494 |
|
|
|
495 |
Button ajouterBouton = creerBoutonAjouterUniteBase();
|
|
|
496 |
barreOutils.add(ajouterBouton);
|
|
|
497 |
|
|
|
498 |
barreOutils.add(new SeparatorToolItem());
|
|
|
499 |
|
|
|
500 |
Button supprimerBouton = creerBoutonSupprimerUniteBase();
|
|
|
501 |
barreOutils.add(supprimerBouton);
|
|
|
502 |
|
|
|
503 |
return barreOutils;
|
|
|
504 |
}
|
|
|
505 |
|
|
|
506 |
private Button creerBoutonAjouterUniteBase() {
|
|
|
507 |
Button bouton = new Button(i18nC.ajouter());
|
|
|
508 |
bouton.setIcon(Images.ICONES.ajouter());
|
|
|
509 |
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
|
510 |
@Override
|
|
|
511 |
public void componentSelected(ButtonEvent ce) {
|
|
|
512 |
final MessageBox box = MessageBox.prompt(i18nC.collectionUniteType(), i18nC.collectionUniteBaseSaisirType());
|
|
|
513 |
box.addCallback(new Listener<MessageBoxEvent>() {
|
|
|
514 |
public void handleEvent(MessageBoxEvent be) {
|
|
|
515 |
final UniteBase unite = new UniteBase();
|
|
|
516 |
unite.setType(be.getValue());
|
|
|
517 |
unite.setTypeAutre(true);
|
|
|
518 |
uniteBaseGrille.getStore().add(unite);
|
|
|
519 |
}
|
|
|
520 |
});
|
|
|
521 |
}
|
|
|
522 |
});
|
|
|
523 |
return bouton;
|
|
|
524 |
}
|
|
|
525 |
|
|
|
526 |
private Button creerBoutonSupprimerUniteBase() {
|
|
|
527 |
Button bouton = new Button(i18nC.supprimer());
|
|
|
528 |
bouton.setIcon(Images.ICONES.supprimer());
|
|
|
529 |
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
|
530 |
@Override
|
|
|
531 |
public void componentSelected(ButtonEvent ce) {
|
|
|
532 |
UniteBase uniteBaseSelectionnee = uniteBaseGrille.getSelectionModel().getSelectedItem();
|
|
|
533 |
if (uniteBaseSelectionnee == null) {
|
|
|
534 |
Info.display(i18nC.informationTitreGenerique(), Mediateur.i18nM.veuillezSelectionner(i18nC.selectionnerUniteBase()));
|
|
|
535 |
} else if (uniteBaseSelectionnee.getTypeAutre() == false) {
|
|
|
536 |
Info.display(i18nC.informationTitreGenerique(), i18nC.selectionnerUniteBaseAjoute());
|
|
|
537 |
} else {
|
|
|
538 |
uniteBaseGrille.getStore().remove(uniteBaseSelectionnee);
|
|
|
539 |
}
|
|
|
540 |
}
|
|
|
541 |
});
|
|
|
542 |
return bouton;
|
|
|
543 |
}
|
|
|
544 |
|
862 |
jpm |
545 |
private void creerFieldsetConservation() {
|
|
|
546 |
FieldSet conservationFieldSet = new FieldSet();
|
|
|
547 |
conservationFieldSet.setHeading("Conservation");
|
|
|
548 |
conservationFieldSet.setCollapsible(true);
|
|
|
549 |
conservationFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
|
|
550 |
|
|
|
551 |
typePapierConservationChp = new ChampCaseACocher(i18nC.typePapierConservation(), "typePapier", true);
|
|
|
552 |
conservationFieldSet.add(typePapierConservationChp);
|
|
|
553 |
|
|
|
554 |
methodeConservationChp = new ChampCaseACocher(i18nC.methodeConservation(), "methodeRangement", true);
|
|
|
555 |
conservationFieldSet.add(methodeConservationChp);
|
|
|
556 |
|
|
|
557 |
this.add(conservationFieldSet);
|
|
|
558 |
}
|
|
|
559 |
|
|
|
560 |
private void creerFieldsetEtiquette() {
|
|
|
561 |
FieldSet etiquetteFieldSet = new FieldSet();
|
|
|
562 |
etiquetteFieldSet.setHeading("Conservation");
|
|
|
563 |
etiquetteFieldSet.setCollapsible(true);
|
|
|
564 |
etiquetteFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
|
|
565 |
|
|
|
566 |
Text fixationPoucentLabel = new Text(i18nC.fixationPourcent());
|
|
|
567 |
etiquetteFieldSet.add(fixationPoucentLabel);
|
|
|
568 |
|
|
|
569 |
specimenFixationPourcentChp = new ChampSliderPourcentage(i18nC.specimenFixationPourcent());
|
|
|
570 |
etiquetteFieldSet.add(specimenFixationPourcentChp, new FormData(200, 0));
|
|
|
571 |
|
|
|
572 |
etiquetteFixationPourcentChp = new ChampSliderPourcentage(i18nC.etiquetteFixationPourcent());
|
|
|
573 |
etiquetteFieldSet.add(etiquetteFixationPourcentChp, new FormData(200, 0));
|
|
|
574 |
|
|
|
575 |
specimentMethodeFixationChp = new ChampCaseACocher(i18nC.specimenMethodeFixation(), "methodeFixation", true);
|
|
|
576 |
etiquetteFieldSet.add(specimentMethodeFixationChp);
|
|
|
577 |
|
|
|
578 |
etiquetteMethodeFixationSurSupportChp = new ChampCaseACocher(i18nC.etiquetteMethodeFixationSurSupport(), "methodeFixation", true);
|
|
|
579 |
etiquetteFieldSet.add(etiquetteMethodeFixationSurSupportChp);
|
|
|
580 |
|
|
|
581 |
etiquetteMethodeFixationSurSpecimenChp = new ChampCaseACocher(i18nC.etiquetteMethodeFixationSurSpecimen(), "methodeFixationSurSpecimen", true);
|
|
|
582 |
etiquetteFieldSet.add(etiquetteMethodeFixationSurSpecimenChp);
|
|
|
583 |
|
|
|
584 |
typeEcritureChp = new ChampCaseACocher(i18nC.typeEcriture(), "typeEcriture", false);
|
|
|
585 |
etiquetteFieldSet.add(typeEcritureChp);
|
|
|
586 |
|
|
|
587 |
this.add(etiquetteFieldSet);
|
|
|
588 |
}
|
|
|
589 |
|
|
|
590 |
private void creerFieldsetTraitement() {
|
|
|
591 |
FieldSet traitementFieldSet = new FieldSet();
|
|
|
592 |
traitementFieldSet.setHeading("Traitements");
|
|
|
593 |
traitementFieldSet.setCollapsible(true);
|
|
|
594 |
traitementFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
|
|
595 |
|
|
|
596 |
traitementCombo = new ChampComboBoxListeValeurs(i18nC.collectionTraitement(), "onpi");
|
|
|
597 |
traitementCombo.setTrie("id_valeur");
|
|
|
598 |
traitementFieldSet.add(traitementCombo, new FormData(300, 0));
|
|
|
599 |
|
|
|
600 |
poisonTraitementChp = new ChampCaseACocher(i18nC.collectionTraitementPoison(), "poisonTraitement", true);
|
|
|
601 |
traitementFieldSet.add(poisonTraitementChp);
|
|
|
602 |
|
|
|
603 |
insecteTraitementChp = new ChampCaseACocher(i18nC.collectionTraitementInsecte(), "insecteTraitement", true);
|
|
|
604 |
traitementFieldSet.add(insecteTraitementChp);
|
|
|
605 |
|
|
|
606 |
this.add(traitementFieldSet);
|
|
|
607 |
}
|
|
|
608 |
|
|
|
609 |
private void creerFieldsetEtat() {
|
|
|
610 |
FieldSet etatFieldSet = new FieldSet();
|
|
|
611 |
etatFieldSet.setHeading("État général et dégradation");
|
|
|
612 |
etatFieldSet.setCollapsible(true);
|
|
|
613 |
etatFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
|
|
614 |
|
|
|
615 |
etatGeneralCombo = new ChampComboBoxListeValeurs(i18nC.collectionEtatGeneral(), "etat");
|
|
|
616 |
etatGeneralCombo.setToolTip(i18nC.collectionEtatGeneralInfo());
|
|
|
617 |
etatGeneralCombo.setTrie("id_valeur");
|
|
|
618 |
etatFieldSet.add(etatGeneralCombo, new FormData(300, 0));
|
|
|
619 |
|
|
|
620 |
specimenDegradationChp = new ChampMultiValeursMultiTypes(i18nC.degradationSpecimen(), 150, true);
|
|
|
621 |
specimenDegradationChp.initialiserType("specimenDegradation");
|
|
|
622 |
specimenDegradationChp.initialiserCombobox("niveauImportance");
|
|
|
623 |
etatFieldSet.add(specimenDegradationChp);
|
|
|
624 |
|
|
|
625 |
presentationDegradationChp = new ChampMultiValeursMultiTypes(i18nC.degradationPresentation(), 150, 200, true);
|
|
|
626 |
presentationDegradationChp.initialiserType("supportDegradation");
|
|
|
627 |
presentationDegradationChp.initialiserCombobox("niveauImportance");
|
|
|
628 |
etatFieldSet.add(presentationDegradationChp);
|
|
|
629 |
|
|
|
630 |
determinationCombo = new ChampComboBoxListeValeurs(i18nC.collectionDetermination(), "niveauDetermination");
|
|
|
631 |
determinationCombo.setTrie("id_valeur");
|
|
|
632 |
etatFieldSet.add(determinationCombo, new FormData(450, 0));
|
|
|
633 |
|
|
|
634 |
this.add(etatFieldSet);
|
|
|
635 |
}
|
|
|
636 |
|
948 |
jpm |
637 |
public void peupler() {
|
|
|
638 |
initialiserCollection();
|
|
|
639 |
if (collectionBotanique != null) {
|
|
|
640 |
typesCollectionBotaCombo.peupler(collectionBotanique.getType());
|
|
|
641 |
if (!UtilString.isEmpty(collectionBotanique.getNbreEchantillon())) {
|
|
|
642 |
nbreEchantillonChp.setValue(Integer.parseInt(collectionBotanique.getNbreEchantillon()));
|
|
|
643 |
}
|
|
|
644 |
peuplerGrilleUniteRangement(collectionBotanique.getUniteRangement());
|
|
|
645 |
}
|
|
|
646 |
}
|
|
|
647 |
|
|
|
648 |
public void collecter() {
|
|
|
649 |
initialiserCollection();
|
|
|
650 |
if (etreAccede()) {
|
|
|
651 |
collectionBotaniqueCollectee.setType(typesCollectionBotaCombo.getValeur());
|
|
|
652 |
collectionBotaniqueCollectee.setNbreEchantillon(Integer.toString(nbreEchantillonChp.getValue().intValue()));
|
|
|
653 |
collectionBotaniqueCollectee.setUniteRangement(collecterGrilleUniteRangement());
|
|
|
654 |
Debug.log(collecterGrilleUniteRangement());
|
|
|
655 |
}
|
|
|
656 |
}
|
|
|
657 |
|
|
|
658 |
private void initialiserCollection() {
|
|
|
659 |
collection = ((CollectionForm) formulaire).collection;
|
|
|
660 |
if (collection != null) {
|
|
|
661 |
collectionBotanique = collection.getBotanique();
|
|
|
662 |
}
|
|
|
663 |
|
|
|
664 |
collectionCollectee = ((CollectionForm) formulaire).collectionCollectee;
|
|
|
665 |
if (collectionCollectee != null) {
|
|
|
666 |
collectionBotaniqueCollectee = collectionCollectee.getBotanique();
|
|
|
667 |
}
|
|
|
668 |
}
|
|
|
669 |
|
806 |
jpm |
670 |
public void rafraichir(Object nouvellesDonnees) {
|
|
|
671 |
if (nouvellesDonnees instanceof ValeurListe) {
|
|
|
672 |
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
|
|
|
673 |
rafraichirValeurListe(listeValeurs);
|
|
|
674 |
} else {
|
|
|
675 |
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
|
|
|
676 |
}
|
|
|
677 |
}
|
|
|
678 |
|
|
|
679 |
private void rafraichirValeurListe(ValeurListe listeValeurs) {
|
858 |
jpm |
680 |
if (listeValeurs.getId().equals(config.getListeId("typeCollectionBota"))) {
|
|
|
681 |
Formulaire.rafraichirComboBox(listeValeurs, typesCollectionBotaCombo);
|
|
|
682 |
} else if (listeValeurs.getId().equals(config.getListeId("typeUniteRangement"))) {
|
806 |
jpm |
683 |
Iterator<String> it = listeValeurs.keySet().iterator();
|
|
|
684 |
while (it.hasNext()) {
|
|
|
685 |
Valeur valeur = listeValeurs.get(it.next());
|
|
|
686 |
UniteRangement unite = new UniteRangement();
|
948 |
jpm |
687 |
unite.setId(valeur.getId());
|
806 |
jpm |
688 |
unite.setType(valeur.getNom());
|
831 |
jpm |
689 |
unite.setTypeAutre(false);
|
806 |
jpm |
690 |
uniteRangementGrille.getStore().add(unite);
|
|
|
691 |
}
|
831 |
jpm |
692 |
} else if (listeValeurs.getId().equals(config.getListeId("typeUniteBase"))) {
|
|
|
693 |
Iterator<String> it = listeValeurs.keySet().iterator();
|
|
|
694 |
while (it.hasNext()) {
|
|
|
695 |
Valeur valeur = listeValeurs.get(it.next());
|
|
|
696 |
UniteBase unite = new UniteBase();
|
948 |
jpm |
697 |
unite.setId(valeur.getId());
|
831 |
jpm |
698 |
unite.setType(valeur.getNom());
|
|
|
699 |
unite.setTypeAutre(false);
|
|
|
700 |
uniteBaseGrille.getStore().add(unite);
|
|
|
701 |
}
|
806 |
jpm |
702 |
} else {
|
|
|
703 |
GWT.log("Gestion de la liste "+listeValeurs.getId()+" non implémenté!", null);
|
|
|
704 |
}
|
|
|
705 |
}
|
|
|
706 |
}
|