150 |
gduche |
1 |
package org.tela_botanica.client.vues;
|
|
|
2 |
|
|
|
3 |
import org.tela_botanica.client.RegistreId;
|
|
|
4 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
|
|
5 |
import org.tela_botanica.client.modeles.Personne;
|
|
|
6 |
import org.tela_botanica.client.modeles.Structure;
|
|
|
7 |
import org.tela_botanica.client.modeles.StructureListe;
|
|
|
8 |
|
|
|
9 |
import com.extjs.gxt.ui.client.Registry;
|
|
|
10 |
import com.extjs.gxt.ui.client.Style.Scroll;
|
|
|
11 |
import com.extjs.gxt.ui.client.util.Format;
|
|
|
12 |
import com.extjs.gxt.ui.client.util.Params;
|
|
|
13 |
import com.extjs.gxt.ui.client.widget.ContentPanel;
|
|
|
14 |
import com.extjs.gxt.ui.client.widget.Html;
|
|
|
15 |
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
|
|
16 |
import com.google.gwt.core.client.GWT;
|
|
|
17 |
import com.google.gwt.user.client.Window;
|
|
|
18 |
|
|
|
19 |
public class PersonneDetailPanneauVue extends ContentPanel implements Rafraichissable {
|
|
|
20 |
|
|
|
21 |
private ContentPanel content;
|
|
|
22 |
private Html header;
|
|
|
23 |
private String enteteHTML = "<div class='coel-detail'><h1>{0}</h1><h2>{1}</h2></div>";
|
|
|
24 |
private String contenuHTML = ""; //<div style='padding: 12px;'><h2>Renseignements administratifs</h2><span style='font-weight:bold;'>Condition d'accès :</span> {9}<br /><span style='font-weight:bold;'>Adresse :</span> {1}, {2} {3}, {4}, {5}<br /><span style='font-weight:bold;'>Téléphone :</span> {6}<br /><span style='font-weight:bold;'>Fax :</span> {7}<br /><span style='font-weight:bold;'>Courriel :</span> {8}<br />{0}</div>";
|
|
|
25 |
private String structureNom = null;
|
|
|
26 |
private String structureVille = null;
|
|
|
27 |
private String structureDescription = null;
|
|
|
28 |
|
|
|
29 |
public PersonneDetailPanneauVue() {
|
|
|
30 |
Registry.register(RegistreId.PANNEAU_PERSONNE_DETAIL, this);
|
|
|
31 |
|
|
|
32 |
setHeaderVisible(false);
|
|
|
33 |
setLayout(new FitLayout());
|
|
|
34 |
|
|
|
35 |
content = new ContentPanel();
|
|
|
36 |
content.setBodyBorder(false);
|
|
|
37 |
content.setHeaderVisible(false);
|
|
|
38 |
content.setScrollMode(Scroll.AUTO);
|
|
|
39 |
|
|
|
40 |
header = new Html();
|
|
|
41 |
header.setStyleName("coel-detail");
|
|
|
42 |
content.setTopComponent(header);
|
|
|
43 |
|
|
|
44 |
add(content);
|
|
|
45 |
}
|
|
|
46 |
|
|
|
47 |
public void afficherDetailPersonne(Personne personne) {
|
|
|
48 |
if (personne != null) {
|
|
|
49 |
content.removeAll();
|
|
|
50 |
|
|
|
51 |
/*structureNom = structure.getNom();
|
|
|
52 |
structureVille = structure.getVille();
|
|
|
53 |
structureDescription = structure.getDescription();
|
|
|
54 |
Params enteteParams = new Params();
|
|
|
55 |
enteteParams.add(structureNom);
|
|
|
56 |
enteteParams.add(structureVille);
|
|
|
57 |
|
|
|
58 |
String eHtml = Format.substitute(enteteHTML, enteteParams);
|
|
|
59 |
header.getElement().setInnerHTML(eHtml);
|
|
|
60 |
|
|
|
61 |
Params contenuParams = new Params();
|
|
|
62 |
contenuParams.add(structureDescription);
|
|
|
63 |
contenuParams.add(structure.getAdresse());
|
|
|
64 |
contenuParams.add(structure.getCodePostal());
|
|
|
65 |
contenuParams.add(structure.getVille());
|
|
|
66 |
contenuParams.add(structure.getRegion());
|
|
|
67 |
contenuParams.add(structure.getPays());
|
|
|
68 |
contenuParams.add(structure.getTelephone());
|
|
|
69 |
contenuParams.add(structure.getFax());
|
|
|
70 |
contenuParams.add(structure.getCourriel());
|
|
|
71 |
contenuParams.add(structure.getConditionAcces());
|
|
|
72 |
|
|
|
73 |
String cHtml = Format.substitute(contenuHTML, contenuParams);
|
|
|
74 |
content.addText(cHtml);
|
|
|
75 |
*/
|
|
|
76 |
layout();
|
|
|
77 |
} else {
|
|
|
78 |
header.setHtml("");
|
|
|
79 |
content.removeAll();
|
|
|
80 |
}
|
|
|
81 |
}
|
|
|
82 |
|
|
|
83 |
public void rafraichir(Object nouvellesDonnees) {
|
|
|
84 |
if (nouvellesDonnees instanceof Personne) {
|
|
|
85 |
afficherDetailPersonne((Personne) nouvellesDonnees);
|
|
|
86 |
}
|
|
|
87 |
|
|
|
88 |
|
|
|
89 |
|
|
|
90 |
/*if (nouvelleDonnees instanceof Structure) {
|
|
|
91 |
afficherDetailInstitution((Structure) nouvelleDonnees);
|
|
|
92 |
} else if (nouvelleDonnees instanceof StructureListe) {
|
|
|
93 |
StructureListe listeInstitutions = (StructureListe) nouvelleDonnees;
|
|
|
94 |
// Test pour savoir si la liste contient des éléments
|
|
|
95 |
if (listeInstitutions.size() == 0) {
|
|
|
96 |
afficherDetailInstitution(null);
|
|
|
97 |
}
|
|
|
98 |
}*/
|
|
|
99 |
}
|
|
|
100 |
|
|
|
101 |
}
|