| Line 3... |
Line 3... |
| 3 |
import org.tela_botanica.client.Mediateur;
|
3 |
import org.tela_botanica.client.Mediateur;
|
| 4 |
import org.tela_botanica.client.RegistreId;
|
4 |
import org.tela_botanica.client.RegistreId;
|
| 5 |
import org.tela_botanica.client.composants.InfoLogger;
|
5 |
import org.tela_botanica.client.composants.InfoLogger;
|
| 6 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
6 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
| 7 |
import org.tela_botanica.client.modeles.Information;
|
7 |
import org.tela_botanica.client.modeles.Information;
|
| - |
|
8 |
import org.tela_botanica.client.modeles.ValeurListe;
|
| 8 |
import org.tela_botanica.client.modeles.personne.Personne;
|
9 |
import org.tela_botanica.client.modeles.personne.Personne;
|
| 9 |
import org.tela_botanica.client.modeles.personne.PersonneListe;
|
10 |
import org.tela_botanica.client.modeles.personne.PersonneListe;
|
| - |
|
11 |
import org.tela_botanica.client.synchronisation.Sequenceur;
|
| 10 |
import org.tela_botanica.client.util.Debug;
|
12 |
import org.tela_botanica.client.util.Debug;
|
| - |
|
13 |
import org.tela_botanica.client.util.UtilString;
|
| Line 11... |
Line 14... |
| 11 |
|
14 |
|
| 12 |
import com.extjs.gxt.ui.client.Registry;
|
15 |
import com.extjs.gxt.ui.client.Registry;
|
| 13 |
import com.extjs.gxt.ui.client.Style.LayoutRegion;
|
16 |
import com.extjs.gxt.ui.client.Style.LayoutRegion;
|
| 14 |
import com.extjs.gxt.ui.client.util.Margins;
|
17 |
import com.extjs.gxt.ui.client.util.Margins;
|
| Line 22... |
Line 25... |
| 22 |
|
25 |
|
| 23 |
private PersonneListeVue panneauPersonneListe;
|
26 |
private PersonneListeVue panneauPersonneListe;
|
| 24 |
private PersonneDetailVue panneauPersonneDetail;
|
27 |
private PersonneDetailVue panneauPersonneDetail;
|
| Line -... |
Line 28... |
| - |
|
28 |
private Mediateur mediateur = null;
|
| - |
|
29 |
|
| - |
|
30 |
//Sequenceur pour la gestion du synchrone
|
| 25 |
private Mediateur mediateur = null;
|
31 |
private Sequenceur sequenceur = new Sequenceur();
|
| 26 |
|
32 |
|
| Line 27... |
Line 33... |
| 27 |
public PersonneVue(Mediateur mediateur) {
|
33 |
public PersonneVue(Mediateur mediateur) {
|
| 28 |
this.mediateur = mediateur;
|
34 |
this.mediateur = mediateur;
|
| 29 |
|
35 |
|
| Line 30... |
Line 36... |
| 30 |
BorderLayout layout = new BorderLayout();
|
36 |
BorderLayout layout = new BorderLayout();
|
| - |
|
37 |
layout.setEnableState(false);
|
| - |
|
38 |
setLayout(layout);
|
| - |
|
39 |
|
| - |
|
40 |
panneauPersonneListe = new PersonneListeVue();
|
| - |
|
41 |
|
| - |
|
42 |
//Charger les ontologies nécessaires à l'affichage des personnes
|
| 31 |
layout.setEnableState(false);
|
43 |
mediateur.obtenirListeValeurEtRafraichir(this, "pays", sequenceur);
|
| Line 32... |
Line 44... |
| 32 |
setLayout(layout);
|
44 |
mediateur.obtenirListeValeurEtRafraichir(this, "tel", sequenceur);
|
| 33 |
|
45 |
mediateur.obtenirListeValeurEtRafraichir(this, "relationPersonnePublication", sequenceur);
|
| 34 |
panneauPersonneListe = new PersonneListeVue();
|
46 |
|
| Line 41... |
Line 53... |
| 41 |
this.add(panneauPersonneDetail, southData);
|
53 |
this.add(panneauPersonneDetail, southData);
|
| 42 |
}
|
54 |
}
|
| Line 43... |
Line 55... |
| 43 |
|
55 |
|
| 44 |
public void rafraichir(Object nouvellesDonnees) {
|
56 |
public void rafraichir(Object nouvellesDonnees) {
|
| - |
|
57 |
if (nouvellesDonnees instanceof Personne) {
|
| 45 |
if (nouvellesDonnees instanceof Personne) {
|
58 |
sequenceur.empilerRafraichissement(panneauPersonneDetail, (Personne) nouvellesDonnees);
|
| 46 |
panneauPersonneDetail.rafraichir((Personne) nouvellesDonnees);
|
59 |
//panneauPersonneDetail.rafraichir((Personne) nouvellesDonnees);
|
| 47 |
} else if (nouvellesDonnees instanceof PersonneListe) {
|
60 |
} else if (nouvellesDonnees instanceof PersonneListe) {
|
| 48 |
panneauPersonneListe.rafraichir((PersonneListe) nouvellesDonnees);
|
61 |
panneauPersonneListe.rafraichir((PersonneListe) nouvellesDonnees);
|
| 49 |
} else if (nouvellesDonnees instanceof Information) {
|
62 |
} else if (nouvellesDonnees instanceof Information) {
|
| - |
|
63 |
Information info = (Information) nouvellesDonnees;
|
| 50 |
Information info = (Information) nouvellesDonnees;
|
64 |
|
| 51 |
// Affichage des éventuels messages de déboguage ou d'alerte
|
65 |
// Affichage des éventuels messages de déboguage ou d'alerte
|
| 52 |
if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
|
66 |
if (!UtilString.isEmpty(info.getMessages())) {
|
| 53 |
GWT.log(info.getMessages().toString(), null);
|
67 |
GWT.log(info.getMessages().toString(), null);
|
| - |
|
68 |
}
|
| 54 |
}
|
69 |
|
| 55 |
// Traitement en fonction des types d'information
|
70 |
// Traitement en fonction des types d'information
|
| 56 |
if (info.getType().equals("liste_personne")) {
|
71 |
if (info.getType().equals("liste_personne")) {
|
| 57 |
panneauPersonneListe.rafraichir((PersonneListe) info.getDonnee(0));
|
72 |
panneauPersonneListe.rafraichir((PersonneListe) info.getDonnee(0));
|
| 58 |
InfoLogger.display("Chargement d'une liste de personnes", "");
|
73 |
InfoLogger.display("Chargement d'une liste de personnes", "");
|
| 59 |
} else {
|
74 |
} else {
|
| 60 |
panneauPersonneListe.rafraichir(info);
|
75 |
panneauPersonneListe.rafraichir(info);
|
| - |
|
76 |
}
|
| - |
|
77 |
} else if (nouvellesDonnees instanceof ValeurListe) {
|
| 61 |
}
|
78 |
panneauPersonneListe.rafraichir((ValeurListe) nouvellesDonnees);
|
| 62 |
} else {
|
79 |
} else {
|
| 63 |
GWT.log(mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
|
80 |
GWT.log(mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
|
| 64 |
}
|
81 |
}
|
| 65 |
}
|
82 |
}
|
| 66 |
}
|
83 |
}
|