1 |
package org.tela_botanica.client.vues;
|
1 |
package org.tela_botanica.client.vues;
|
2 |
|
2 |
|
3 |
import java.util.ArrayList;
|
3 |
import java.util.ArrayList;
|
4 |
import java.util.Iterator;
|
4 |
import java.util.Iterator;
|
5 |
import java.util.List;
|
5 |
import java.util.List;
|
6 |
|
6 |
|
7 |
import org.tela_botanica.client.Mediateur;
|
7 |
import org.tela_botanica.client.Mediateur;
|
8 |
import org.tela_botanica.client.images.Images;
|
8 |
import org.tela_botanica.client.images.Images;
|
9 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
9 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
10 |
import org.tela_botanica.client.modeles.Information;
|
10 |
import org.tela_botanica.client.modeles.Information;
|
11 |
import org.tela_botanica.client.modeles.InterneValeur;
|
11 |
import org.tela_botanica.client.modeles.InterneValeur;
|
12 |
import org.tela_botanica.client.modeles.Personne;
|
12 |
import org.tela_botanica.client.modeles.Personne;
|
13 |
import org.tela_botanica.client.modeles.PersonneListe;
|
13 |
import org.tela_botanica.client.modeles.PersonneListe;
|
14 |
import org.tela_botanica.client.modeles.UniteBase;
|
14 |
import org.tela_botanica.client.modeles.UniteBase;
|
15 |
import org.tela_botanica.client.modeles.UniteRangement;
|
15 |
import org.tela_botanica.client.modeles.UniteRangement;
|
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 |
|
18 |
|
19 |
import com.extjs.gxt.ui.client.event.BaseEvent;
|
19 |
import com.extjs.gxt.ui.client.event.BaseEvent;
|
20 |
import com.extjs.gxt.ui.client.event.ButtonEvent;
|
20 |
import com.extjs.gxt.ui.client.event.ButtonEvent;
|
21 |
import com.extjs.gxt.ui.client.event.ComponentEvent;
|
21 |
import com.extjs.gxt.ui.client.event.ComponentEvent;
|
22 |
import com.extjs.gxt.ui.client.event.EventType;
|
22 |
import com.extjs.gxt.ui.client.event.EventType;
|
23 |
import com.extjs.gxt.ui.client.event.Events;
|
23 |
import com.extjs.gxt.ui.client.event.Events;
|
24 |
import com.extjs.gxt.ui.client.event.KeyListener;
|
24 |
import com.extjs.gxt.ui.client.event.KeyListener;
|
25 |
import com.extjs.gxt.ui.client.event.Listener;
|
25 |
import com.extjs.gxt.ui.client.event.Listener;
|
26 |
import com.extjs.gxt.ui.client.event.SelectionListener;
|
26 |
import com.extjs.gxt.ui.client.event.SelectionListener;
|
27 |
import com.extjs.gxt.ui.client.store.ListStore;
|
27 |
import com.extjs.gxt.ui.client.store.ListStore;
|
28 |
import com.extjs.gxt.ui.client.store.Store;
|
28 |
import com.extjs.gxt.ui.client.store.Store;
|
29 |
import com.extjs.gxt.ui.client.store.StoreEvent;
|
29 |
import com.extjs.gxt.ui.client.store.StoreEvent;
|
30 |
import com.extjs.gxt.ui.client.widget.ContentPanel;
|
30 |
import com.extjs.gxt.ui.client.widget.ContentPanel;
|
31 |
import com.extjs.gxt.ui.client.widget.Info;
|
31 |
import com.extjs.gxt.ui.client.widget.Info;
|
- |
|
32 |
import com.extjs.gxt.ui.client.widget.Text;
|
32 |
import com.extjs.gxt.ui.client.widget.button.Button;
|
33 |
import com.extjs.gxt.ui.client.widget.button.Button;
|
33 |
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
|
34 |
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
|
34 |
import com.extjs.gxt.ui.client.widget.form.ComboBox;
|
35 |
import com.extjs.gxt.ui.client.widget.form.ComboBox;
|
35 |
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
|
36 |
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
|
36 |
import com.extjs.gxt.ui.client.widget.grid.CellEditor;
|
37 |
import com.extjs.gxt.ui.client.widget.grid.CellEditor;
|
37 |
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
|
38 |
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
|
38 |
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
|
39 |
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
|
39 |
import com.extjs.gxt.ui.client.widget.grid.EditorGrid;
|
40 |
import com.extjs.gxt.ui.client.widget.grid.EditorGrid;
|
40 |
import com.extjs.gxt.ui.client.widget.grid.Grid;
|
41 |
import com.extjs.gxt.ui.client.widget.grid.Grid;
|
41 |
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
|
42 |
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
|
42 |
import com.extjs.gxt.ui.client.widget.grid.HeaderGroupConfig;
|
43 |
import com.extjs.gxt.ui.client.widget.grid.HeaderGroupConfig;
|
43 |
import com.extjs.gxt.ui.client.widget.grid.RowNumberer;
|
44 |
import com.extjs.gxt.ui.client.widget.grid.RowNumberer;
|
44 |
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
45 |
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
45 |
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
|
46 |
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
|
46 |
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
47 |
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
47 |
import com.google.gwt.core.client.GWT;
|
48 |
import com.google.gwt.core.client.GWT;
|
48 |
import com.google.gwt.event.dom.client.KeyCodes;
|
49 |
import com.google.gwt.event.dom.client.KeyCodes;
|
49 |
|
50 |
|
50 |
public class CollectionFormPersonne extends FormulaireOnglet implements Rafraichissable {
|
51 |
public class CollectionFormPersonne extends FormulaireOnglet implements Rafraichissable {
|
51 |
|
52 |
|
52 |
private ContentPanel panneauPrincipal = null;
|
53 |
private ContentPanel panneauPrincipal = null;
|
53 |
private ToolBar barreOutils = null;
|
54 |
private ToolBar barreOutils = null;
|
54 |
private Grid<Personne> grille;
|
55 |
private Grid<Personne> grille;
|
55 |
private ComboBox<Valeur> typeRelationCombo = null;
|
56 |
private ComboBox<Valeur> typeRelationCombo = null;
|
56 |
|
57 |
|
57 |
private PersonneListe personnes = null;
|
58 |
private PersonneListe personnes = null;
|
58 |
private PersonneListe personnesAjoutes = null;
|
59 |
private PersonneListe personnesAjoutes = null;
|
59 |
private PersonneListe personnesSupprimes = null;
|
60 |
private PersonneListe personnesSupprimes = null;
|
60 |
private ComboBox<Personne> personnesSaisisComboBox = null;
|
61 |
private ComboBox<Personne> personnesSaisisComboBox = null;
|
61 |
private Button personnesBoutonSupprimer = null;
|
62 |
private Button personnesBoutonSupprimer = null;
|
62 |
private Button personnesBoutonModifier = null;
|
63 |
private Button personnesBoutonModifier = null;
|
63 |
private Button ajouterPersonneSaisiBouton = null;
|
64 |
private Button ajouterPersonneSaisiBouton = null;
|
64 |
|
65 |
|
65 |
private static final String ETAT_AJOUTE = "A";
|
66 |
private static final String ETAT_AJOUTE = "A";
|
66 |
private static final String ETAT_SUPPRIME = "S";
|
67 |
private static final String ETAT_SUPPRIME = "S";
|
67 |
|
68 |
|
68 |
public CollectionFormPersonne(Formulaire formulaireCourrant) {
|
69 |
public CollectionFormPersonne(Formulaire formulaireCourrant) {
|
69 |
initialiserOnglet(formulaireCourrant);
|
70 |
initialiserOnglet(formulaireCourrant);
|
70 |
setId("personne");
|
71 |
setId("personne");
|
71 |
setText(Mediateur.i18nC.collectionPersonne());
|
72 |
setText(Mediateur.i18nC.collectionPersonne());
|
72 |
setStyleAttribute("padding", "0");
|
73 |
setStyleAttribute("padding", "0");
|
73 |
|
74 |
|
74 |
panneauPrincipal = creerPanneauContenantGrille();
|
75 |
panneauPrincipal = creerPanneauContenantGrille();
|
75 |
barreOutils = creerBarreOutilsGrille();
|
76 |
barreOutils = creerBarreOutilsGrille();
|
76 |
panneauPrincipal.setTopComponent(barreOutils);
|
77 |
panneauPrincipal.setTopComponent(barreOutils);
|
77 |
grille = creerGrille();
|
78 |
grille = creerGrille();
|
78 |
panneauPrincipal.add(grille);
|
79 |
panneauPrincipal.add(grille);
|
79 |
mediateur.obtenirListeValeurEtRafraichir(this, "relationPersonneCollection");
|
80 |
mediateur.obtenirListeValeurEtRafraichir(this, "relationPersonneCollection");
|
80 |
add(panneauPrincipal);
|
81 |
add(panneauPrincipal);
|
81 |
|
82 |
|
82 |
initialiser();
|
83 |
initialiser();
|
83 |
}
|
84 |
}
|
84 |
|
85 |
|
85 |
private void initialiser() {
|
86 |
private void initialiser() {
|
86 |
// Remise à zéro des modification dans la liste des auteurs
|
87 |
// Remise à zéro des modification dans la liste des auteurs
|
87 |
personnesAjoutes = new PersonneListe();
|
88 |
personnesAjoutes = new PersonneListe();
|
88 |
personnesSupprimes = new PersonneListe();
|
89 |
personnesSupprimes = new PersonneListe();
|
89 |
|
90 |
|
90 |
// Actualisation de l'état des boutons de la barre d'outils
|
91 |
// Actualisation de l'état des boutons de la barre d'outils
|
91 |
actualiserEtatBoutonsBarreOutils();
|
92 |
actualiserEtatBoutonsBarreOutils();
|
92 |
}
|
93 |
}
|
93 |
|
94 |
|
94 |
private ContentPanel creerPanneauContenantGrille() {
|
95 |
private ContentPanel creerPanneauContenantGrille() {
|
95 |
ContentPanel panneau = new ContentPanel();
|
96 |
ContentPanel panneau = new ContentPanel();
|
96 |
|
97 |
|
97 |
panneau.setHeading(i18nC.collectionPersonneTitre());
|
98 |
panneau.setHeading(i18nC.collectionPersonneTitre());
|
98 |
panneau.setIcon(Images.ICONES.table());
|
99 |
panneau.setIcon(Images.ICONES.table());
|
99 |
panneau.setLayout(new FitLayout());
|
100 |
panneau.setLayout(new FitLayout());
|
100 |
panneau.setFrame(true);
|
101 |
panneau.setFrame(true);
|
101 |
|
102 |
|
102 |
return panneau;
|
103 |
return panneau;
|
103 |
}
|
104 |
}
|
104 |
|
105 |
|
105 |
private ToolBar creerBarreOutilsGrille() {
|
106 |
private ToolBar creerBarreOutilsGrille() {
|
106 |
ToolBar barreOutils = new ToolBar();
|
107 |
ToolBar barreOutils = new ToolBar();
|
107 |
|
108 |
|
108 |
Button ajouterPersonneBouton = creerBoutonAjouter();
|
109 |
Button ajouterPersonneBouton = creerBoutonAjouter();
|
109 |
barreOutils.add(ajouterPersonneBouton);
|
110 |
barreOutils.add(ajouterPersonneBouton);
|
- |
|
111 |
|
- |
|
112 |
barreOutils.add(new Text(" ou "));
|
- |
|
113 |
|
- |
|
114 |
personnesSaisisComboBox = creerComboBoxAuteursSaisis();
|
- |
|
115 |
barreOutils.add(personnesSaisisComboBox);
|
110 |
|
116 |
|
111 |
barreOutils.add(new SeparatorToolItem());
|
117 |
barreOutils.add(new SeparatorToolItem());
|
112 |
|
118 |
|
113 |
personnesBoutonModifier = creerBoutonModifier();
|
119 |
personnesBoutonModifier = creerBoutonModifier();
|
114 |
barreOutils.add(personnesBoutonModifier);
|
120 |
barreOutils.add(personnesBoutonModifier);
|
115 |
|
121 |
|
116 |
barreOutils.add(new SeparatorToolItem());
|
122 |
barreOutils.add(new SeparatorToolItem());
|
117 |
|
123 |
|
118 |
personnesBoutonSupprimer = creerBoutonSupprimer();
|
124 |
personnesBoutonSupprimer = creerBoutonSupprimer();
|
119 |
barreOutils.add(personnesBoutonSupprimer);
|
125 |
barreOutils.add(personnesBoutonSupprimer);
|
120 |
|
126 |
|
121 |
barreOutils.add(new SeparatorToolItem());
|
127 |
barreOutils.add(new SeparatorToolItem());
|
122 |
|
128 |
|
123 |
Button rafraichirPersonneBouton = creerBoutonRafraichir();
|
129 |
Button rafraichirPersonneBouton = creerBoutonRafraichir();
|
124 |
barreOutils.add(rafraichirPersonneBouton);
|
130 |
barreOutils.add(rafraichirPersonneBouton);
|
125 |
|
131 |
|
126 |
barreOutils.add(new SeparatorToolItem());
|
- |
|
127 |
|
- |
|
128 |
personnesSaisisComboBox = creerComboBoxAuteursSaisis();
|
- |
|
129 |
barreOutils.add(personnesSaisisComboBox);
|
- |
|
130 |
|
- |
|
131 |
ajouterPersonneSaisiBouton = creerBoutonAjouterPersonneSaisie();
|
- |
|
132 |
barreOutils.add(ajouterPersonneSaisiBouton);
|
- |
|
133 |
|
- |
|
134 |
return barreOutils;
|
132 |
return barreOutils;
|
135 |
}
|
133 |
}
|
136 |
|
134 |
|
137 |
private Button creerBoutonAjouter() {
|
135 |
private Button creerBoutonAjouter() {
|
138 |
Button bouton = new Button(i18nC.ajouter());
|
136 |
Button bouton = new Button(i18nC.ajouter());
|
139 |
bouton.setIcon(Images.ICONES.vcardAjouter());
|
137 |
bouton.setIcon(Images.ICONES.vcardAjouter());
|
140 |
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
138 |
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
141 |
@Override
|
139 |
@Override
|
142 |
public void componentSelected(ButtonEvent ce) {
|
140 |
public void componentSelected(ButtonEvent ce) {
|
143 |
FenetreForm fenetre = creerFenetreModaleAvecFormulairePersonne(Formulaire.MODE_AJOUTER);
|
141 |
FenetreForm fenetre = creerFenetreModaleAvecFormulairePersonne(Formulaire.MODE_AJOUTER);
|
144 |
fenetre.show();
|
142 |
fenetre.show();
|
145 |
}
|
143 |
}
|
146 |
});
|
144 |
});
|
147 |
return bouton;
|
145 |
return bouton;
|
148 |
}
|
146 |
}
|
149 |
|
147 |
|
150 |
private Button creerBoutonModifier() {
|
148 |
private Button creerBoutonModifier() {
|
151 |
Button bouton = new Button(i18nC.modifier());
|
149 |
Button bouton = new Button(i18nC.modifier());
|
152 |
bouton.setIcon(Images.ICONES.vcardModifier());
|
150 |
bouton.setIcon(Images.ICONES.vcardModifier());
|
153 |
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
151 |
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
154 |
@Override
|
152 |
@Override
|
155 |
public void componentSelected(ButtonEvent ce) {
|
153 |
public void componentSelected(ButtonEvent ce) {
|
156 |
Personne auteurSaisiSelectionne = grille.getSelectionModel().getSelectedItem();
|
154 |
Personne auteurSaisiSelectionne = grille.getSelectionModel().getSelectedItem();
|
157 |
if (auteurSaisiSelectionne == null) {
|
155 |
if (auteurSaisiSelectionne == null) {
|
158 |
Info.display(i18nC.informationTitreGenerique(), i18nC.selectionnerPersonne());
|
156 |
Info.display(i18nC.informationTitreGenerique(), i18nC.selectionnerPersonne());
|
159 |
} else {
|
157 |
} else {
|
160 |
FenetreForm fenetre = creerFenetreModaleAvecFormulairePersonne(Formulaire.MODE_MODIFIER);
|
158 |
FenetreForm fenetre = creerFenetreModaleAvecFormulairePersonne(Formulaire.MODE_MODIFIER);
|
161 |
fenetre.show();
|
159 |
fenetre.show();
|
162 |
}
|
160 |
}
|
163 |
}
|
161 |
}
|
164 |
});
|
162 |
});
|
165 |
return bouton;
|
163 |
return bouton;
|
166 |
}
|
164 |
}
|
167 |
|
165 |
|
168 |
private FenetreForm creerFenetreModaleAvecFormulairePersonne(String mode) {
|
166 |
private FenetreForm creerFenetreModaleAvecFormulairePersonne(String mode) {
|
169 |
final FenetreForm fenetre = new FenetreForm("");
|
167 |
final FenetreForm fenetre = new FenetreForm("");
|
170 |
final PersonneForm formulaire = creerFormulairePersonne(fenetre);
|
168 |
final PersonneForm formulaire = creerFormulairePersonne(fenetre);
|
171 |
fenetre.add(formulaire);
|
169 |
fenetre.add(formulaire);
|
172 |
return fenetre;
|
170 |
return fenetre;
|
173 |
}
|
171 |
}
|
174 |
|
172 |
|
175 |
private PersonneForm creerFormulairePersonne(final FenetreForm fenetre) {
|
173 |
private PersonneForm creerFormulairePersonne(final FenetreForm fenetre) {
|
176 |
PersonneForm formulaire = new PersonneForm(mediateur, PersonneForm.MODE_AJOUTER, null);
|
174 |
PersonneForm formulaire = new PersonneForm(mediateur, PersonneForm.MODE_AJOUTER, null);
|
177 |
/*fenetre.setHeading(formulaire.getHeading());
|
175 |
/*fenetre.setHeading(formulaire.getHeading());
|
178 |
formulaire.setHeaderVisible(false);
|
176 |
formulaire.setHeaderVisible(false);
|
179 |
formulaire.setTopComponent(null);*/
|
177 |
formulaire.setTopComponent(null);*/
|
180 |
|
178 |
|
181 |
// TODO : gérer la barre d'outil avec des évènements spécifique au contexte de fenêtre modale
|
179 |
// TODO : gérer la barre d'outil avec des évènements spécifique au contexte de fenêtre modale
|
182 |
SelectionListener<ButtonEvent> ecouteur = creerEcouteurValidationFormulairePersonne(fenetre, formulaire);
|
180 |
SelectionListener<ButtonEvent> ecouteur = creerEcouteurValidationFormulairePersonne(fenetre, formulaire);
|
183 |
final ButtonBar barreValidation = new FormulaireBarreValidation(ecouteur);
|
181 |
final ButtonBar barreValidation = new FormulaireBarreValidation(ecouteur);
|
184 |
//formulaire.setBottomComponent(barreValidation);
|
182 |
//formulaire.setBottomComponent(barreValidation);
|
185 |
|
183 |
|
186 |
if (mode.equals(Formulaire.MODE_MODIFIER)) {
|
184 |
if (mode.equals(Formulaire.MODE_MODIFIER)) {
|
187 |
// TODO : simplifier la gestion de l'ajout des données d'une Personne au form pour la modification... (pas besoin de passer par une liste).
|
185 |
// TODO : simplifier la gestion de l'ajout des données d'une Personne au form pour la modification... (pas besoin de passer par une liste).
|
188 |
Information info = new Information("liste_personne");
|
186 |
Information info = new Information("liste_personne");
|
189 |
PersonneListe personnes = new PersonneListe();
|
187 |
PersonneListe personnes = new PersonneListe();
|
190 |
Personne auteurSaisiSelectionne = grille.getSelectionModel().getSelectedItem();
|
188 |
Personne auteurSaisiSelectionne = grille.getSelectionModel().getSelectedItem();
|
191 |
personnes.put(auteurSaisiSelectionne.getId(), auteurSaisiSelectionne);
|
189 |
personnes.put(auteurSaisiSelectionne.getId(), auteurSaisiSelectionne);
|
192 |
info.setDonnee(0, personnes);
|
190 |
info.setDonnee(0, personnes);
|
193 |
formulaire.rafraichir(info);
|
191 |
formulaire.rafraichir(info);
|
194 |
}
|
192 |
}
|
195 |
|
193 |
|
196 |
return formulaire;
|
194 |
return formulaire;
|
197 |
}
|
195 |
}
|
198 |
|
196 |
|
199 |
private SelectionListener<ButtonEvent> creerEcouteurValidationFormulairePersonne(final FenetreForm fenetre, final PersonneForm formulaire) {
|
197 |
private SelectionListener<ButtonEvent> creerEcouteurValidationFormulairePersonne(final FenetreForm fenetre, final PersonneForm formulaire) {
|
200 |
SelectionListener<ButtonEvent> ecouteur = new SelectionListener<ButtonEvent>() {
|
198 |
SelectionListener<ButtonEvent> ecouteur = new SelectionListener<ButtonEvent>() {
|
201 |
@Override
|
199 |
@Override
|
202 |
public void componentSelected(ButtonEvent ce) {
|
200 |
public void componentSelected(ButtonEvent ce) {
|
203 |
String code = ((Button) ce.getComponent()).getData("code");
|
201 |
String code = ((Button) ce.getComponent()).getData("code");
|
204 |
if (code.equals(FormulaireBarreValidation.CODE_BOUTON_VALIDER)) {
|
202 |
if (code.equals(FormulaireBarreValidation.CODE_BOUTON_VALIDER)) {
|
205 |
Boolean ok = formulaire.enregistrer();
|
203 |
Boolean ok = formulaire.enregistrer();
|
206 |
if (ok == true) {
|
204 |
if (ok == true) {
|
207 |
// Fermer fenêtre et ajouter/modifier l'élément dans la liste
|
205 |
// Fermer fenêtre et ajouter/modifier l'élément dans la liste
|
208 |
}
|
206 |
}
|
209 |
fenetre.hide();
|
207 |
fenetre.hide();
|
210 |
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_APPLIQUER)) {
|
208 |
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_APPLIQUER)) {
|
211 |
Boolean ok = formulaire.enregistrer();
|
209 |
Boolean ok = formulaire.enregistrer();
|
212 |
if (ok == true) {
|
210 |
if (ok == true) {
|
213 |
// Fermer fenêtre et ajouter/modifier l'élément dans la liste
|
211 |
// Fermer fenêtre et ajouter/modifier l'élément dans la liste
|
214 |
}
|
212 |
}
|
215 |
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_ANNULER)) {
|
213 |
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_ANNULER)) {
|
216 |
fenetre.hide();
|
214 |
fenetre.hide();
|
217 |
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_REINITIALISER)) {
|
215 |
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_REINITIALISER)) {
|
218 |
formulaire.reinitialiserFormulaire();
|
216 |
formulaire.reinitialiserFormulaire();
|
219 |
}
|
217 |
}
|
220 |
}
|
218 |
}
|
221 |
};
|
219 |
};
|
222 |
|
220 |
|
223 |
return ecouteur;
|
221 |
return ecouteur;
|
224 |
}
|
222 |
}
|
225 |
|
223 |
|
226 |
private Button creerBoutonSupprimer() {
|
224 |
private Button creerBoutonSupprimer() {
|
227 |
Button bouton = new Button(i18nC.supprimer());
|
225 |
Button bouton = new Button(i18nC.supprimer());
|
228 |
bouton.setIcon(Images.ICONES.vcardSupprimer());
|
226 |
bouton.setIcon(Images.ICONES.vcardSupprimer());
|
229 |
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
227 |
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
230 |
@Override
|
228 |
@Override
|
231 |
public void componentSelected(ButtonEvent ce) {
|
229 |
public void componentSelected(ButtonEvent ce) {
|
232 |
Personne auteurSaisiSelectionne = grille.getSelectionModel().getSelectedItem();
|
230 |
Personne auteurSaisiSelectionne = grille.getSelectionModel().getSelectedItem();
|
233 |
if (auteurSaisiSelectionne == null) {
|
231 |
if (auteurSaisiSelectionne == null) {
|
234 |
Info.display(i18nC.informationTitreGenerique(), i18nC.selectionnerPersonne());
|
232 |
Info.display(i18nC.informationTitreGenerique(), i18nC.selectionnerPersonne());
|
235 |
} else {
|
233 |
} else {
|
236 |
supprimerDansGrille(auteurSaisiSelectionne);
|
234 |
supprimerDansGrille(auteurSaisiSelectionne);
|
237 |
}
|
235 |
}
|
238 |
}
|
236 |
}
|
239 |
});
|
237 |
});
|
240 |
return bouton;
|
238 |
return bouton;
|
241 |
}
|
239 |
}
|
242 |
|
240 |
|
243 |
private Button creerBoutonRafraichir() {
|
241 |
private Button creerBoutonRafraichir() {
|
244 |
Button bouton = new Button(i18nC.rafraichir());
|
242 |
Button bouton = new Button(i18nC.rafraichir());
|
245 |
bouton.setIcon(Images.ICONES.rafraichir());
|
243 |
bouton.setIcon(Images.ICONES.rafraichir());
|
246 |
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
244 |
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
247 |
@Override
|
245 |
@Override
|
248 |
public void componentSelected(ButtonEvent ce) {
|
246 |
public void componentSelected(ButtonEvent ce) {
|
249 |
// TODO : mettre en place le rafraichissement de la liste
|
247 |
// TODO : mettre en place le rafraichissement de la liste
|
250 |
}
|
248 |
}
|
251 |
});
|
249 |
});
|
252 |
return bouton;
|
250 |
return bouton;
|
253 |
}
|
251 |
}
|
254 |
|
252 |
|
255 |
private ComboBox<Personne> creerComboBoxAuteursSaisis() {
|
253 |
private ComboBox<Personne> creerComboBoxAuteursSaisis() {
|
256 |
ListStore<Personne> personnesSaisiesStore = new ListStore<Personne>();
|
254 |
ListStore<Personne> personnesSaisiesStore = new ListStore<Personne>();
|
257 |
personnesSaisiesStore.add(new ArrayList<Personne>());
|
255 |
personnesSaisiesStore.add(new ArrayList<Personne>());
|
258 |
|
256 |
|
259 |
ComboBox<Personne> comboBox = new ComboBox<Personne>();
|
257 |
ComboBox<Personne> comboBox = new ComboBox<Personne>();
|
260 |
comboBox.setWidth(200);
|
258 |
comboBox.setWidth(200);
|
261 |
comboBox.setEmptyText(i18nC.chercherPersonneSaisi());
|
259 |
comboBox.setEmptyText(i18nC.chercherPersonneSaisi());
|
262 |
comboBox.setTriggerAction(TriggerAction.ALL);
|
260 |
comboBox.setTriggerAction(TriggerAction.ALL);
|
263 |
comboBox.setEditable(true);
|
261 |
comboBox.setEditable(true);
|
264 |
comboBox.setDisplayField("fmt_nom_complet");
|
262 |
comboBox.setDisplayField("fmt_nom_complet");
|
265 |
comboBox.setStore(personnesSaisiesStore);
|
263 |
comboBox.setStore(personnesSaisiesStore);
|
266 |
comboBox.addKeyListener(new KeyListener() {
|
264 |
comboBox.addKeyListener(new KeyListener() {
|
267 |
public void componentKeyUp(ComponentEvent ce) {
|
265 |
public void componentKeyUp(ComponentEvent ce) {
|
268 |
if (personnesSaisisComboBox.getRawValue() != null && personnesSaisisComboBox.getRawValue().length() > 0) {
|
266 |
if (personnesSaisisComboBox.getRawValue() != null && personnesSaisisComboBox.getRawValue().length() > 0) {
|
269 |
if (!ce.isNavKeyPress()) {
|
267 |
if (!ce.isNavKeyPress()) {
|
270 |
obtenirPersonnesSaisis(personnesSaisisComboBox.getRawValue());
|
268 |
obtenirPersonnesSaisis(personnesSaisisComboBox.getRawValue());
|
271 |
}
|
269 |
}
|
272 |
}
|
270 |
}
|
273 |
}
|
271 |
}
|
274 |
});
|
272 |
});
|
275 |
comboBox.addListener(Events.Select, new Listener<BaseEvent>() {
|
273 |
comboBox.addListener(Events.Select, new Listener<BaseEvent>() {
|
276 |
@Override
|
274 |
@Override
|
277 |
public void handleEvent(BaseEvent be) {
|
275 |
public void handleEvent(BaseEvent be) {
|
278 |
if (personnesSaisisComboBox.getValue() instanceof Personne) {
|
276 |
if (personnesSaisisComboBox.getValue() instanceof Personne) {
|
- |
|
277 |
Personne auteurSaisiSelectionne = personnesSaisisComboBox.getValue();
|
279 |
ajouterPersonneSaisiBouton.fireEvent(Events.Select);
|
278 |
ajouterDansGrille(auteurSaisiSelectionne);
|
- |
|
279 |
personnesSaisisComboBox.setValue(null);
|
280 |
}
|
280 |
}
|
281 |
}
|
281 |
}
|
282 |
});
|
282 |
});
|
283 |
return comboBox;
|
283 |
return comboBox;
|
284 |
}
|
284 |
}
|
285 |
|
- |
|
286 |
private Button creerBoutonAjouterPersonneSaisie() {
|
- |
|
287 |
Button bouton = new Button(i18nC.ajouter());
|
- |
|
288 |
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
- |
|
289 |
@Override
|
- |
|
290 |
public void componentSelected(ButtonEvent ce) {
|
- |
|
291 |
Personne auteurSaisiSelectionne = personnesSaisisComboBox.getValue();
|
- |
|
292 |
ajouterDansGrille(auteurSaisiSelectionne);
|
- |
|
293 |
personnesSaisisComboBox.setValue(null);
|
- |
|
294 |
}
|
- |
|
295 |
});
|
- |
|
296 |
return bouton;
|
- |
|
297 |
}
|
- |
|
298 |
|
285 |
|
299 |
private void ajouterDansGrille(Personne personne) {
|
286 |
private void ajouterDansGrille(Personne personne) {
|
300 |
if (personne != null) {
|
287 |
if (personne != null) {
|
301 |
// Ajout de la personne ajoutée à la liste
|
288 |
// Ajout de la personne ajoutée à la liste
|
302 |
if (personne.getId() != null && !personne.getId().equals("")) {
|
289 |
if (personne.getId() != null && !personne.getId().equals("")) {
|
303 |
personnesAjoutes.put(personne.getId(), personne);
|
290 |
personnesAjoutes.put(personne.getId(), personne);
|
304 |
}
|
291 |
}
|
305 |
|
292 |
|
306 |
// Définition de l'état
|
293 |
// Définition de l'état
|
307 |
personne.set("etat", ETAT_AJOUTE);
|
294 |
personne.set("etat", ETAT_AJOUTE);
|
308 |
|
295 |
|
309 |
// Ajout à la grille
|
296 |
// Ajout à la grille
|
310 |
grille.getStore().insert(personne, 0);
|
297 |
grille.getStore().insert(personne, 0);
|
311 |
grille.getSelectionModel().select(0, false);
|
298 |
grille.getSelectionModel().select(0, false);
|
312 |
}
|
299 |
}
|
313 |
}
|
300 |
}
|
314 |
|
301 |
|
315 |
private void supprimerDansGrille(Personne personne) {
|
302 |
private void supprimerDansGrille(Personne personne) {
|
316 |
if (personne != null) {
|
303 |
if (personne != null) {
|
317 |
// Ajout de la personne supprimée à la liste
|
304 |
// Ajout de la personne supprimée à la liste
|
318 |
if ((personne.get("etat") == null || !personne.get("etat").equals(ETAT_AJOUTE)) && personne.getId() != null && !personne.getId().equals("")) {
|
305 |
if ((personne.get("etat") == null || !personne.get("etat").equals(ETAT_AJOUTE)) && personne.getId() != null && !personne.getId().equals("")) {
|
319 |
personnesSupprimes.put(personne.getId(), personne);
|
306 |
personnesSupprimes.put(personne.getId(), personne);
|
320 |
}
|
307 |
}
|
321 |
|
308 |
|
322 |
// Suppression de l'enregistrement de la grille
|
309 |
// Suppression de l'enregistrement de la grille
|
323 |
grille.getStore().remove(personne);
|
310 |
grille.getStore().remove(personne);
|
324 |
}
|
311 |
}
|
325 |
}
|
312 |
}
|
326 |
|
313 |
|
327 |
private Grid<Personne> creerGrille() {
|
314 |
private Grid<Personne> creerGrille() {
|
328 |
ListStore<Personne> storeGrille = new ListStore<Personne>();
|
315 |
ListStore<Personne> storeGrille = new ListStore<Personne>();
|
329 |
storeGrille.addListener(Store.Add, new Listener<StoreEvent<Personne>>() {
|
316 |
storeGrille.addListener(Store.Add, new Listener<StoreEvent<Personne>>() {
|
330 |
public void handleEvent(StoreEvent<Personne> ce) {
|
317 |
public void handleEvent(StoreEvent<Personne> ce) {
|
331 |
actualiserEtatBoutonsBarreOutils();
|
318 |
actualiserEtatBoutonsBarreOutils();
|
332 |
}
|
319 |
}
|
333 |
});
|
320 |
});
|
334 |
storeGrille.addListener(Store.Remove, new Listener<StoreEvent<Personne>>() {
|
321 |
storeGrille.addListener(Store.Remove, new Listener<StoreEvent<Personne>>() {
|
335 |
public void handleEvent(StoreEvent<Personne> ce) {
|
322 |
public void handleEvent(StoreEvent<Personne> ce) {
|
336 |
actualiserEtatBoutonsBarreOutils();
|
323 |
actualiserEtatBoutonsBarreOutils();
|
337 |
}
|
324 |
}
|
338 |
});
|
325 |
});
|
339 |
|
326 |
|
340 |
RowNumberer pluginLigneNumero = new RowNumberer();
|
327 |
RowNumberer pluginLigneNumero = new RowNumberer();
|
341 |
|
328 |
|
342 |
List<ColumnConfig> colonnes = new ArrayList<ColumnConfig>();
|
329 |
List<ColumnConfig> colonnes = new ArrayList<ColumnConfig>();
|
343 |
colonnes.add(pluginLigneNumero);
|
330 |
colonnes.add(pluginLigneNumero);
|
344 |
|
331 |
|
345 |
typeRelationCombo = new ComboBox<Valeur>();
|
332 |
typeRelationCombo = new ComboBox<Valeur>();
|
346 |
typeRelationCombo.setForceSelection(true);
|
333 |
typeRelationCombo.setForceSelection(true);
|
347 |
typeRelationCombo.setTriggerAction(TriggerAction.ALL);
|
334 |
typeRelationCombo.setTriggerAction(TriggerAction.ALL);
|
348 |
typeRelationCombo.setDisplayField("nom");
|
335 |
typeRelationCombo.setDisplayField("nom");
|
349 |
typeRelationCombo.setStore(new ListStore<Valeur>());
|
336 |
typeRelationCombo.setStore(new ListStore<Valeur>());
|
350 |
typeRelationCombo.setEditable(false);
|
337 |
typeRelationCombo.setEditable(false);
|
351 |
|
338 |
|
352 |
CellEditor editeurRelation = new CellEditor(typeRelationCombo) {
|
339 |
CellEditor editeurRelation = new CellEditor(typeRelationCombo) {
|
353 |
@Override
|
340 |
@Override
|
354 |
public Object preProcessValue(Object valeur) {
|
341 |
public Object preProcessValue(Object valeur) {
|
355 |
Valeur retour = null;
|
342 |
Valeur retour = null;
|
356 |
if (valeur != null ) {
|
343 |
if (valeur != null ) {
|
357 |
if (typeRelationCombo.getStore().findModel("nom", valeur.toString()) != null) {
|
344 |
if (typeRelationCombo.getStore().findModel("nom", valeur.toString()) != null) {
|
358 |
retour = typeRelationCombo.getStore().findModel("nom", valeur.toString());
|
345 |
retour = typeRelationCombo.getStore().findModel("nom", valeur.toString());
|
359 |
} else if (typeRelationCombo.getStore().findModel("abr", valeur.toString()) != null) {
|
346 |
} else if (typeRelationCombo.getStore().findModel("abr", valeur.toString()) != null) {
|
360 |
retour = typeRelationCombo.getStore().findModel("abr", valeur.toString());
|
347 |
retour = typeRelationCombo.getStore().findModel("abr", valeur.toString());
|
361 |
}
|
348 |
}
|
362 |
}
|
349 |
}
|
363 |
return retour;
|
350 |
return retour;
|
364 |
}
|
351 |
}
|
365 |
|
352 |
|
366 |
@Override
|
353 |
@Override
|
367 |
public Object postProcessValue(Object valeur) {
|
354 |
public Object postProcessValue(Object valeur) {
|
368 |
String retour = null;
|
355 |
String retour = null;
|
369 |
if (valeur != null ) {
|
356 |
if (valeur != null ) {
|
370 |
if (valeur instanceof Valeur) {
|
357 |
if (valeur instanceof Valeur) {
|
371 |
Valeur valeurOntologie = (Valeur) valeur;
|
358 |
Valeur valeurOntologie = (Valeur) valeur;
|
372 |
retour = valeurOntologie.getNom();
|
359 |
retour = valeurOntologie.getNom();
|
373 |
}
|
360 |
}
|
374 |
}
|
361 |
}
|
375 |
return retour;
|
362 |
return retour;
|
376 |
}
|
363 |
}
|
377 |
};
|
364 |
};
|
378 |
|
365 |
|
379 |
ColumnConfig typeRelationColonne = new ColumnConfig("type_relation", i18nC.typeRelationPersonneCollection(), 75);
|
366 |
ColumnConfig typeRelationColonne = new ColumnConfig("type_relation", i18nC.typeRelationPersonneCollection(), 75);
|
380 |
typeRelationColonne.setEditor(editeurRelation);
|
367 |
typeRelationColonne.setEditor(editeurRelation);
|
381 |
colonnes.add(typeRelationColonne);
|
368 |
colonnes.add(typeRelationColonne);
|
382 |
|
369 |
|
383 |
colonnes.add(new ColumnConfig("fmt_nom_complet", i18nC.personneNomComplet(), 150));
|
370 |
colonnes.add(new ColumnConfig("fmt_nom_complet", i18nC.personneNomComplet(), 150));
|
384 |
colonnes.add(new ColumnConfig("nom", i18nC.personneNom(), 75));
|
371 |
colonnes.add(new ColumnConfig("nom", i18nC.personneNom(), 75));
|
385 |
colonnes.add(new ColumnConfig("prenom", i18nC.personnePrenom(), 75));
|
372 |
colonnes.add(new ColumnConfig("prenom", i18nC.personnePrenom(), 75));
|
386 |
colonnes.add(new ColumnConfig("prefixe", i18nC.personnePrefixe(), 50));
|
373 |
colonnes.add(new ColumnConfig("prefixe", i18nC.personnePrefixe(), 50));
|
387 |
//colonnes.add(new ColumnConfig("truk_nom_autre", i18nC.personneNomAutre(), 200));
|
374 |
//colonnes.add(new ColumnConfig("truk_nom_autre", i18nC.personneNomAutre(), 200));
|
388 |
colonnes.add(new ColumnConfig("naissance_date", i18nC.date(), 75));
|
375 |
colonnes.add(new ColumnConfig("naissance_date", i18nC.date(), 75));
|
389 |
colonnes.add(new ColumnConfig("naissance_lieu", i18nC.lieu(), 100));
|
376 |
colonnes.add(new ColumnConfig("naissance_lieu", i18nC.lieu(), 100));
|
390 |
colonnes.add(new ColumnConfig("ce_deces", i18nC.personneDecedeeInterogation(), 50));
|
377 |
colonnes.add(new ColumnConfig("ce_deces", i18nC.personneDecedeeInterogation(), 50));
|
391 |
colonnes.add(new ColumnConfig("deces_date", i18nC.date(), 75));
|
378 |
colonnes.add(new ColumnConfig("deces_date", i18nC.date(), 75));
|
392 |
colonnes.add(new ColumnConfig("deces_lieu", i18nC.lieu(), 100));
|
379 |
colonnes.add(new ColumnConfig("deces_lieu", i18nC.lieu(), 100));
|
393 |
|
380 |
|
394 |
GridSelectionModel<Personne> modeleDeSelection = new GridSelectionModel<Personne>();
|
381 |
GridSelectionModel<Personne> modeleDeSelection = new GridSelectionModel<Personne>();
|
395 |
|
382 |
|
396 |
ColumnModel modeleDeColonnes = new ColumnModel(colonnes);
|
383 |
ColumnModel modeleDeColonnes = new ColumnModel(colonnes);
|
397 |
modeleDeColonnes.addHeaderGroup(0, 1, new HeaderGroupConfig(i18nC.personneIdentite(), 1, 4));
|
384 |
modeleDeColonnes.addHeaderGroup(0, 1, new HeaderGroupConfig(i18nC.personneIdentite(), 1, 4));
|
398 |
modeleDeColonnes.addHeaderGroup(0, 5, new HeaderGroupConfig(i18nC.personneNaissance(), 1, 2));
|
385 |
modeleDeColonnes.addHeaderGroup(0, 5, new HeaderGroupConfig(i18nC.personneNaissance(), 1, 2));
|
399 |
modeleDeColonnes.addHeaderGroup(0, 7, new HeaderGroupConfig(i18nC.personneDeces(), 1, 3));
|
386 |
modeleDeColonnes.addHeaderGroup(0, 7, new HeaderGroupConfig(i18nC.personneDeces(), 1, 3));
|
400 |
|
387 |
|
401 |
EditorGrid<Personne> grillePersonne = new EditorGrid<Personne>(storeGrille, modeleDeColonnes);
|
388 |
EditorGrid<Personne> grillePersonne = new EditorGrid<Personne>(storeGrille, modeleDeColonnes);
|
402 |
grillePersonne.setHeight("100%");
|
389 |
grillePersonne.setHeight("100%");
|
403 |
grillePersonne.setBorders(true);
|
390 |
grillePersonne.setBorders(true);
|
404 |
grillePersonne.setSelectionModel(modeleDeSelection);
|
391 |
grillePersonne.setSelectionModel(modeleDeSelection);
|
405 |
grillePersonne.addPlugin(pluginLigneNumero);
|
392 |
grillePersonne.addPlugin(pluginLigneNumero);
|
406 |
grillePersonne.getView().setForceFit(true);
|
393 |
grillePersonne.getView().setForceFit(true);
|
407 |
grillePersonne.setAutoExpandColumn("fmt_nom_complet");
|
394 |
grillePersonne.setAutoExpandColumn("fmt_nom_complet");
|
408 |
grillePersonne.setStripeRows(true);
|
395 |
grillePersonne.setStripeRows(true);
|
409 |
grillePersonne.setTrackMouseOver(true);
|
396 |
grillePersonne.setTrackMouseOver(true);
|
410 |
|
397 |
|
411 |
return grillePersonne;
|
398 |
return grillePersonne;
|
412 |
}
|
399 |
}
|
413 |
|
400 |
|
414 |
public void actualiserEtatBoutonsBarreOutils() {
|
401 |
public void actualiserEtatBoutonsBarreOutils() {
|
415 |
// Activation des boutons si la grille contient un élément
|
402 |
// Activation des boutons si la grille contient un élément
|
416 |
if (grille.getStore().getCount() > 0) {
|
403 |
if (grille.getStore().getCount() > 0) {
|
417 |
personnesBoutonSupprimer.enable();
|
404 |
personnesBoutonSupprimer.enable();
|
418 |
personnesBoutonModifier.enable();
|
405 |
personnesBoutonModifier.enable();
|
419 |
}
|
406 |
}
|
420 |
// Désactivation des boutons si la grille ne contient plus d'élément
|
407 |
// Désactivation des boutons si la grille ne contient plus d'élément
|
421 |
if (grille.getStore().getCount() == 0) {
|
408 |
if (grille.getStore().getCount() == 0) {
|
422 |
personnesBoutonSupprimer.disable();
|
409 |
personnesBoutonSupprimer.disable();
|
423 |
personnesBoutonModifier.disable();
|
410 |
personnesBoutonModifier.disable();
|
424 |
}
|
411 |
}
|
425 |
}
|
412 |
}
|
426 |
|
413 |
|
427 |
public void rafraichir(Object nouvellesDonnees) {
|
414 |
public void rafraichir(Object nouvellesDonnees) {
|
428 |
if (nouvellesDonnees instanceof ValeurListe) {
|
415 |
if (nouvellesDonnees instanceof ValeurListe) {
|
429 |
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
|
416 |
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
|
430 |
rafraichirValeurListe(listeValeurs);
|
417 |
rafraichirValeurListe(listeValeurs);
|
431 |
} else if (nouvellesDonnees instanceof Information) {
|
418 |
} else if (nouvellesDonnees instanceof Information) {
|
432 |
Information info = (Information) nouvellesDonnees;
|
419 |
Information info = (Information) nouvellesDonnees;
|
433 |
rafraichirInformation(info);
|
420 |
rafraichirInformation(info);
|
434 |
} else {
|
421 |
} else {
|
435 |
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
|
422 |
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
|
436 |
}
|
423 |
}
|
437 |
}
|
424 |
}
|
438 |
|
425 |
|
439 |
private void rafraichirValeurListe(ValeurListe listeValeurs) {
|
426 |
private void rafraichirValeurListe(ValeurListe listeValeurs) {
|
440 |
if (listeValeurs.getId().equals(config.getListeId("relationPersonneCollection"))) {
|
427 |
if (listeValeurs.getId().equals(config.getListeId("relationPersonneCollection"))) {
|
441 |
Formulaire.rafraichirComboBox(listeValeurs, typeRelationCombo);
|
428 |
Formulaire.rafraichirComboBox(listeValeurs, typeRelationCombo);
|
442 |
} else {
|
429 |
} else {
|
443 |
GWT.log("Gestion de la liste "+listeValeurs.getId()+" non implémenté!", null);
|
430 |
GWT.log("Gestion de la liste "+listeValeurs.getId()+" non implémenté!", null);
|
444 |
}
|
431 |
}
|
445 |
}
|
432 |
}
|
446 |
|
433 |
|
447 |
public void rafraichirInformation(Information info) {
|
434 |
public void rafraichirInformation(Information info) {
|
448 |
if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
|
435 |
if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
|
449 |
GWT.log("MESSAGES:\n"+info.getMessages().toString(), null);
|
436 |
GWT.log("MESSAGES:\n"+info.getMessages().toString(), null);
|
450 |
}
|
437 |
}
|
451 |
String type = info.getType();
|
438 |
String type = info.getType();
|
452 |
if (type.equals("liste_personne")) {
|
439 |
if (type.equals("liste_personne")) {
|
453 |
if (info.getDonnee(0) != null) {
|
440 |
if (info.getDonnee(0) != null) {
|
454 |
PersonneListe personnes = (PersonneListe) info.getDonnee(0);
|
441 |
PersonneListe personnes = (PersonneListe) info.getDonnee(0);
|
455 |
List<Personne> liste = personnes.toList();
|
442 |
List<Personne> liste = personnes.toList();
|
456 |
|
443 |
|
457 |
personnesSaisisComboBox.getStore().removeAll();
|
444 |
personnesSaisisComboBox.getStore().removeAll();
|
458 |
personnesSaisisComboBox.getStore().add(liste);
|
445 |
personnesSaisisComboBox.getStore().add(liste);
|
459 |
personnesSaisisComboBox.expand();
|
446 |
personnesSaisisComboBox.expand();
|
460 |
}
|
447 |
}
|
461 |
} else if (type.equals("liste_collection_a_personne")) {
|
448 |
} else if (type.equals("liste_collection_a_personne")) {
|
462 |
if (info.getDonnee(0) != null) {
|
449 |
if (info.getDonnee(0) != null) {
|
463 |
initialiser();
|
450 |
initialiser();
|
464 |
// TODO : passer à la méthode peupler un objet CollectionAPersonneListe et modifier le type de auteurs
|
451 |
// TODO : passer à la méthode peupler un objet CollectionAPersonneListe et modifier le type de auteurs
|
465 |
//auteurs = (CollectionAPersonneListe) info.getDonnee(0);
|
452 |
//auteurs = (CollectionAPersonneListe) info.getDonnee(0);
|
466 |
peupler();
|
453 |
peupler();
|
467 |
}
|
454 |
}
|
468 |
}
|
455 |
}
|
469 |
}
|
456 |
}
|
470 |
|
457 |
|
471 |
private void peupler() {
|
458 |
private void peupler() {
|
472 |
layout();
|
459 |
layout();
|
473 |
Info.display(i18nC.chargementPersonne(), i18nC.ok());
|
460 |
Info.display(i18nC.chargementPersonne(), i18nC.ok());
|
474 |
}
|
461 |
}
|
475 |
|
462 |
|
476 |
private void obtenirPersonnesSaisis(String nom) {
|
463 |
private void obtenirPersonnesSaisis(String nom) {
|
477 |
mediateur.selectionnerPersonneParNomComplet(this, null, nom+"%");
|
464 |
mediateur.selectionnerPersonneParNomComplet(this, null, nom+"%");
|
478 |
}
|
465 |
}
|
479 |
}
|
466 |
}
|