| Line 1... |
Line 1... |
| 1 |
package org.tela_botanica.client.vues;
|
1 |
package org.tela_botanica.client.vues;
|
| Line 2... |
Line -... |
| 2 |
|
- |
|
| 3 |
import java.util.List;
|
- |
|
| 4 |
|
2 |
|
| 5 |
import org.tela_botanica.client.Mediateur;
|
3 |
import org.tela_botanica.client.Mediateur;
|
| 6 |
import org.tela_botanica.client.composants.ChampMultiValeurs;
|
4 |
import org.tela_botanica.client.composants.ChampMultiValeurs;
|
| 7 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
5 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
| 8 |
import org.tela_botanica.client.modeles.Collection;
|
6 |
import org.tela_botanica.client.modeles.Collection;
|
| Line 11... |
Line 9... |
| 11 |
import org.tela_botanica.client.modeles.ProjetListe;
|
9 |
import org.tela_botanica.client.modeles.ProjetListe;
|
| 12 |
import org.tela_botanica.client.modeles.Structure;
|
10 |
import org.tela_botanica.client.modeles.Structure;
|
| 13 |
import org.tela_botanica.client.modeles.StructureListe;
|
11 |
import org.tela_botanica.client.modeles.StructureListe;
|
| 14 |
import org.tela_botanica.client.modeles.Valeur;
|
12 |
import org.tela_botanica.client.modeles.Valeur;
|
| 15 |
import org.tela_botanica.client.modeles.ValeurListe;
|
13 |
import org.tela_botanica.client.modeles.ValeurListe;
|
| 16 |
import org.tela_botanica.client.modeles.aDonnee;
|
- |
|
| 17 |
import org.tela_botanica.client.modeles.aDonneeListe;
|
- |
|
| 18 |
|
- |
|
| 19 |
import com.extjs.gxt.ui.client.Style.SortDir;
|
- |
|
| 20 |
import com.extjs.gxt.ui.client.store.ListStore;
|
14 |
import com.extjs.gxt.ui.client.store.ListStore;
|
| 21 |
import com.extjs.gxt.ui.client.widget.form.ComboBox;
|
15 |
import com.extjs.gxt.ui.client.widget.form.ComboBox;
|
| 22 |
import com.extjs.gxt.ui.client.widget.form.Field;
|
16 |
import com.extjs.gxt.ui.client.widget.form.Field;
|
| 23 |
import com.extjs.gxt.ui.client.widget.form.FieldSet;
|
17 |
import com.extjs.gxt.ui.client.widget.form.FieldSet;
|
| 24 |
import com.extjs.gxt.ui.client.widget.form.HiddenField;
|
18 |
import com.extjs.gxt.ui.client.widget.form.HiddenField;
|
| Line 303... |
Line 297... |
| 303 |
if (nouvellesDonnees instanceof ValeurListe) {
|
297 |
if (nouvellesDonnees instanceof ValeurListe) {
|
| 304 |
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
|
298 |
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
|
| 305 |
rafraichirValeurListe(listeValeurs);
|
299 |
rafraichirValeurListe(listeValeurs);
|
| 306 |
} else if (nouvellesDonnees instanceof ProjetListe) {
|
300 |
} else if (nouvellesDonnees instanceof ProjetListe) {
|
| 307 |
ProjetListe projets = (ProjetListe) nouvellesDonnees;
|
301 |
ProjetListe projets = (ProjetListe) nouvellesDonnees;
|
| 308 |
rafraichirComboBox(projets, projetsStore, projetsCombo);
|
302 |
Formulaire.rafraichirComboBox(projets, projetsStore, projetsCombo);
|
| 309 |
} else if (nouvellesDonnees instanceof StructureListe) {
|
303 |
} else if (nouvellesDonnees instanceof StructureListe) {
|
| 310 |
StructureListe structures = (StructureListe) nouvellesDonnees;
|
304 |
StructureListe structures = (StructureListe) nouvellesDonnees;
|
| 311 |
rafraichirComboBox(structures, structuresStore, structuresCombo);
|
305 |
Formulaire.rafraichirComboBox(structures, structuresStore, structuresCombo);
|
| 312 |
} else if (nouvellesDonnees instanceof CollectionListe) {
|
306 |
} else if (nouvellesDonnees instanceof CollectionListe) {
|
| 313 |
CollectionListe collections = (CollectionListe) nouvellesDonnees;
|
307 |
CollectionListe collections = (CollectionListe) nouvellesDonnees;
|
| 314 |
rafraichirComboBox(collections, collectionsStore, collectionsCombo);
|
308 |
Formulaire.rafraichirComboBox(collections, collectionsStore, collectionsCombo);
|
| 315 |
} else {
|
309 |
} else {
|
| 316 |
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
|
310 |
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
|
| 317 |
}
|
311 |
}
|
| 318 |
}
|
312 |
}
|
| Line 319... |
Line 313... |
| 319 |
|
313 |
|
| 320 |
private void rafraichirValeurListe(ValeurListe listeValeurs) {
|
314 |
private void rafraichirValeurListe(ValeurListe listeValeurs) {
|
| 321 |
if (listeValeurs.getId().equals(config.getListeId("typeCollectionNcd"))) {
|
315 |
if (listeValeurs.getId().equals(config.getListeId("typeCollectionNcd"))) {
|
| 322 |
rafraichirComboBox(listeValeurs, typesCollectionStore, typesCollectionCombo);
|
316 |
Formulaire.rafraichirComboBox(listeValeurs, typesCollectionStore, typesCollectionCombo);
|
| 323 |
} else if (listeValeurs.getId().equals(config.getListeId("typeCollectionBota"))) {
|
317 |
} else if (listeValeurs.getId().equals(config.getListeId("typeCollectionBota"))) {
|
| 324 |
rafraichirComboBox(listeValeurs, typeCollectionBotaStore, typesCollectionBotaCombo);
|
318 |
Formulaire.rafraichirComboBox(listeValeurs, typeCollectionBotaStore, typesCollectionBotaCombo);
|
| 325 |
} else if (listeValeurs.getId().equals(config.getListeId("typeDepot"))) {
|
319 |
} else if (listeValeurs.getId().equals(config.getListeId("typeDepot"))) {
|
| 326 |
rafraichirComboBox(listeValeurs, typeDepotStore, typeDepotCombo);
|
320 |
Formulaire.rafraichirComboBox(listeValeurs, typeDepotStore, typeDepotCombo);
|
| 327 |
} else {
|
321 |
} else {
|
| 328 |
GWT.log("Gestion de la liste "+listeValeurs.getId()+" non implémenté!", null);
|
322 |
GWT.log("Gestion de la liste "+listeValeurs.getId()+" non implémenté!", null);
|
| 329 |
}
|
323 |
}
|
| Line 330... |
Line -... |
| 330 |
}
|
- |
|
| 331 |
|
- |
|
| 332 |
@SuppressWarnings({"unchecked"})
|
- |
|
| 333 |
private void rafraichirComboBox(aDonneeListe<?> listeValeurs, ListStore store, ComboBox combo) {
|
- |
|
| 334 |
List<?> liste = listeValeurs.toList();
|
- |
|
| 335 |
if (liste.size() > 0) {
|
- |
|
| 336 |
store.removeAll();
|
- |
|
| 337 |
store.add(liste);
|
- |
|
| 338 |
store.sort("nom", SortDir.ASC);
|
- |
|
| 339 |
combo.setStore(store);
|
324 |
}
|
| Line 340... |
Line 325... |
| 340 |
}
|
325 |
|