Line 11... |
Line 11... |
11 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
11 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
12 |
import org.tela_botanica.client.modeles.Information;
|
12 |
import org.tela_botanica.client.modeles.Information;
|
13 |
import org.tela_botanica.client.modeles.Utilisateur;
|
13 |
import org.tela_botanica.client.modeles.Utilisateur;
|
14 |
import org.tela_botanica.client.modeles.personne.Personne;
|
14 |
import org.tela_botanica.client.modeles.personne.Personne;
|
15 |
import org.tela_botanica.client.modeles.personne.PersonneListe;
|
15 |
import org.tela_botanica.client.modeles.personne.PersonneListe;
|
- |
|
16 |
import org.tela_botanica.client.modeles.projet.Projet;
|
16 |
import org.tela_botanica.client.util.Debug;
|
17 |
import org.tela_botanica.client.util.Debug;
|
17 |
import org.tela_botanica.client.vues.BarrePaginationVue;
|
18 |
import org.tela_botanica.client.vues.BarrePaginationVue;
|
Line 18... |
Line 19... |
18 |
|
19 |
|
19 |
import com.extjs.gxt.ui.client.Registry;
|
20 |
import com.extjs.gxt.ui.client.Registry;
|
Line 47... |
Line 48... |
47 |
private ColumnModel modeleColonnes = null;
|
48 |
private ColumnModel modeleColonnes = null;
|
48 |
private Button ajouter = null;
|
49 |
private Button ajouter = null;
|
49 |
private Button modifier = null;
|
50 |
private Button modifier = null;
|
50 |
private Button supprimer = null;
|
51 |
private Button supprimer = null;
|
Line -... |
Line 52... |
- |
|
52 |
|
- |
|
53 |
private int indexElementSelectionne = 0;
|
- |
|
54 |
private Personne personneSelectionnee = null;
|
51 |
|
55 |
|
52 |
public PersonneListeVue() {
|
56 |
public PersonneListeVue() {
|
Line 53... |
Line 57... |
53 |
mediateur = Registry.get(RegistreId.MEDIATEUR);
|
57 |
mediateur = Registry.get(RegistreId.MEDIATEUR);
|
54 |
|
58 |
|
Line 103... |
Line 107... |
103 |
|
107 |
|
104 |
// Définition de la grille
|
108 |
// Définition de la grille
|
105 |
GridSelectionModel<Personne> gsmSelectionGrille = new GridSelectionModel<Personne>();
|
109 |
GridSelectionModel<Personne> gsmSelectionGrille = new GridSelectionModel<Personne>();
|
106 |
gsmSelectionGrille.addSelectionChangedListener(new SelectionChangedListener<Personne>() {
|
110 |
gsmSelectionGrille.addSelectionChangedListener(new SelectionChangedListener<Personne>() {
|
107 |
public void selectionChanged(SelectionChangedEvent<Personne> event) {
|
111 |
public void selectionChanged(SelectionChangedEvent<Personne> event) {
|
- |
|
112 |
personneSelectionnee = (Personne) event.getSelectedItem();
|
108 |
Personne personneSelectionnee = (Personne) event.getSelectedItem();
|
113 |
indexElementSelectionne = store.indexOf(personneSelectionnee);
|
109 |
clicListe(personneSelectionnee);
|
114 |
clicListe(personneSelectionnee);
|
110 |
}
|
115 |
}
|
Line 111... |
Line 116... |
111 |
});
|
116 |
});
|
Line 179... |
Line 184... |
179 |
mediateur.actualiserPanneauCentral();
|
184 |
mediateur.actualiserPanneauCentral();
|
180 |
grille.fireEvent(Events.ViewReady);
|
185 |
grille.fireEvent(Events.ViewReady);
|
181 |
}
|
186 |
}
|
182 |
} else if (nouvellesDonnees instanceof Information) {
|
187 |
} else if (nouvellesDonnees instanceof Information) {
|
183 |
Information info = (Information) nouvellesDonnees;
|
188 |
Information info = (Information) nouvellesDonnees;
|
- |
|
189 |
if (info.getType().equals("maj_utilisateur")) {
|
- |
|
190 |
gererEtatActivationBouton();
|
- |
|
191 |
} else if(info.getType().equals("personne_modifiee")) {
|
- |
|
192 |
if(personneSelectionnee != null) {
|
- |
|
193 |
store.remove(indexElementSelectionne);
|
- |
|
194 |
personneSelectionnee = null;
|
- |
|
195 |
}
|
- |
|
196 |
Personne personneModifiee = (Personne)info.getDonnee(0);
|
- |
|
197 |
// au cas ou le bouton appliquer aurait été cliqué avant de valider
|
- |
|
198 |
store.remove(personneModifiee);
|
- |
|
199 |
store.insert(personneModifiee, indexElementSelectionne);
|
- |
|
200 |
grille.repaint();
|
- |
|
201 |
grille.getSelectionModel().select(indexElementSelectionne, true);
|
- |
|
202 |
clicListe(personneModifiee);
|
184 |
if (info.getType().equals("suppression_personne")) {
|
203 |
} else if (info.getType().equals("suppression_personne")) {
|
185 |
InfoLogger.display("Suppression de personne", info.getMessages().toString());
|
204 |
InfoLogger.display("Suppression de personne", info.getMessages().toString());
|
186 |
pagination.getlistePaginable().recharger();
|
205 |
pagination.getlistePaginable().recharger();
|
187 |
gererEtatActivationBouton();
|
206 |
gererEtatActivationBouton();
|
188 |
} else if (info.getType().equals("maj_utilisateur")) {
|
207 |
} else if (info.getType().equals("maj_utilisateur")) {
|
189 |
gererEtatActivationBouton();
|
208 |
gererEtatActivationBouton();
|