Subversion Repositories eFlore/Applications.coel

Rev

Rev 119 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 119 Rev 373
Line 1... Line 1...
1
package org.tela_botanica.client.vues;
1
package org.tela_botanica.client.vues;
Line -... Line 2...
-
 
2
 
-
 
3
import org.tela_botanica.client.ComposantId;
2
 
4
import org.tela_botanica.client.Mediateur;
3
import org.tela_botanica.client.RegistreId;
5
import org.tela_botanica.client.RegistreId;
4
import org.tela_botanica.client.interfaces.Rafraichissable;
6
import org.tela_botanica.client.interfaces.Rafraichissable;
5
import org.tela_botanica.client.modeles.Structure;
-
 
Line 6... Line 7...
6
import org.tela_botanica.client.modeles.StructureListe;
7
import org.tela_botanica.client.modeles.Structure;
7
 
8
 
8
import com.extjs.gxt.ui.client.Registry;
9
import com.extjs.gxt.ui.client.Registry;
9
import com.extjs.gxt.ui.client.Style.Scroll;
10
import com.extjs.gxt.ui.client.Style.Scroll;
10
import com.extjs.gxt.ui.client.util.Format;
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;
11
import com.extjs.gxt.ui.client.util.Params;
14
import com.extjs.gxt.ui.client.widget.HtmlContainer;
-
 
15
import com.extjs.gxt.ui.client.widget.LayoutContainer;
12
import com.extjs.gxt.ui.client.widget.ContentPanel;
16
import com.extjs.gxt.ui.client.widget.TabItem;
-
 
17
import com.extjs.gxt.ui.client.widget.TabPanel;
Line 13... Line 18...
13
import com.extjs.gxt.ui.client.widget.Html;
18
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
-
 
19
import com.google.gwt.core.client.GWT;
-
 
20
 
Line 14... Line -...
14
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
-
 
15
 
-
 
16
public class StructureDetailPanneauVue extends ContentPanel implements Rafraichissable {
21
public class StructureDetailPanneauVue extends LayoutContainer implements Rafraichissable {
17
 
22
 
-
 
23
	private Mediateur mediateur = null;
18
	private ContentPanel content;
24
	
19
	private Html header;
-
 
20
	private String enteteHTML = "<div class='coel-detail'><h1>{0}</h1><h2>{1}</h2></div>";
-
 
Line -... Line 25...
-
 
25
	private String enteteHTML = "<div class='coel-detail'><h1>{0}</h1><h2>{1}</h2></div>";
-
 
26
	private String contenuHTML = null;
-
 
27
	
-
 
28
	private Structure structure = null;
-
 
29
	
21
	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>";
30
	private ContentPanel panneauPrincipal = null;
-
 
31
	private HtmlContainer entete = null;
22
	private String structureNom = null;
32
	private TabPanel onglets = null;
-
 
33
	private TabItem identificationOnglet = null;
-
 
34
 
Line 23... Line -...
23
	private String structureVille = null;
-
 
24
	private String structureDescription = null;
35
	public StructureDetailPanneauVue(Mediateur mediateurCourant) {
-
 
36
		mediateur = mediateurCourant;
-
 
37
		Registry.register(RegistreId.PANNEAU_INSTITUTION_DETAIL, this);
-
 
38
		initialiserEnteteHtmlTpl();
-
 
39
		initialiserContenuHtmlTpl();
Line 25... Line 40...
25
 
40
		
26
	public StructureDetailPanneauVue() {
-
 
27
		Registry.register(RegistreId.PANNEAU_INSTITUTION_DETAIL, this);
-
 
28
		
-
 
Line 29... Line 41...
29
		setHeaderVisible(false);
41
		setLayout(new FitLayout());
30
		setLayout(new FitLayout());
42
		setBorders(false);
31
 
43
		setScrollMode(Scroll.AUTO);
Line -... Line 44...
-
 
44
		
-
 
45
		panneauPrincipal = new ContentPanel();
-
 
46
		
-
 
47
		entete = new HtmlContainer();
-
 
48
		
32
		content = new ContentPanel();
49
		onglets = new TabPanel();
33
		content.setBodyBorder(false);
50
		onglets.setAutoHeight(true);
Line 34... Line 51...
34
		content.setHeaderVisible(false);
51
		onglets.setAutoWidth(true);
-
 
52
		
35
		content.setScrollMode(Scroll.AUTO);
53
		identificationOnglet = new TabItem("Général");
36
 
54
		onglets.add(identificationOnglet);
Line 37... Line 55...
37
		header = new Html();
55
		
38
		header.setStyleName("coel-detail");
56
		panneauPrincipal.add(entete);
-
 
57
		panneauPrincipal.add(onglets);
39
		content.setTopComponent(header);
58
		add(panneauPrincipal);
-
 
59
	}
Line -... Line 60...
-
 
60
 
40
 
61
	private void afficherDetailInstitution(Structure structureCourante) {
-
 
62
		removeAll();
41
		add(content);
63
		if (structureCourante != null) {
42
	}
64
			structure = structureCourante;
Line 43... Line 65...
43
 
65
 
44
	public void afficherDetailInstitution(Structure structure) {
66
			afficherEntete();
-
 
67
			afficherIdentification();
Line -... Line 68...
-
 
68
		}
45
		if (structure != null) {
69
		panneauPrincipal.layout();
46
			content.removeAll();
70
	}
47
			
71
	
48
			structureNom = structure.getNom();
72
	private void afficherEntete() {
49
			structureVille = structure.getVille();
73
		Params enteteParams = new Params();
50
			structureDescription = structure.getDescription();
74
		enteteParams.add(ComposantId.ZONE_DETAIL);
51
 
75
		enteteParams.add(structure.getNom());
52
			Params enteteParams = new Params();
76
		enteteParams.add(structure.getVille());
53
			enteteParams.add(structureNom);
77
		
54
			enteteParams.add(structureVille);
78
		String eHtml = Format.substitute(enteteHTML, enteteParams);
55
 
79
		entete.getElement().setInnerHTML(eHtml);
-
 
80
	}
Line 56... Line 81...
56
			String eHtml = Format.substitute(enteteHTML, enteteParams);
81
	
57
			header.getElement().setInnerHTML(eHtml);
82
	private void afficherIdentification() {
58
 
-
 
59
			Params contenuParams = new Params();
-
 
60
			contenuParams.add(structureDescription);
-
 
61
			contenuParams.add(structure.getAdresse());
-
 
62
			contenuParams.add(structure.getCodePostal());
83
		Params contenuParams = new Params();
63
			contenuParams.add(structure.getVille());
84
		contenuParams.add(structure.getDescription());
-
 
85
		contenuParams.add(structure.getAdresse());
-
 
86
		contenuParams.add(structure.getCodePostal());
-
 
87
		contenuParams.add(structure.getVille());
-
 
88
		contenuParams.add(structure.getRegion());
-
 
89
		contenuParams.add(structure.getPays());
-
 
90
		contenuParams.add(structure.getTelephone());
-
 
91
		contenuParams.add(structure.getFax());
-
 
92
		contenuParams.add(structure.getCourriel());
-
 
93
		contenuParams.add(structure.getConditionAcces());
-
 
94
		contenuParams.add(ComposantId.ZONE_DETAIL_CORPS);
-
 
95
 
-
 
96
		String cHtml = Format.substitute(contenuHTML, contenuParams);
-
 
97
		HtmlContainer corpsConteneurDuHtml = new HtmlContainer(cHtml);
-
 
98
		identificationOnglet.add(corpsConteneurDuHtml);
-
 
99
	}
-
 
100
	
-
 
101
	private void initialiserEnteteHtmlTpl() {
-
 
102
		enteteHTML = 	"<div id='{0}'>"+
64
			contenuParams.add(structure.getRegion());
103
						"	<h1>{1}</h1>"+
Line 65... Line 104...
65
			contenuParams.add(structure.getPays());
104
						"	<h2>{2}</h2>" +
66
			contenuParams.add(structure.getTelephone());
105
						"</div>";
67
			contenuParams.add(structure.getFax());
106
	}
68
			contenuParams.add(structure.getCourriel());
107
	
69
			contenuParams.add(structure.getConditionAcces());
108
	private void initialiserContenuHtmlTpl() {
70
			
-
 
71
			String cHtml = Format.substitute(contenuHTML, contenuParams);
-
 
72
			content.addText(cHtml);
-
 
73
 
-
 
74
			layout();
109
		contenuHTML = 	"<div id='{10}'>"+
75
		} else {
110
						"	<h2>Renseignements administratifs</h2>"+
Line 76... Line 111...
76
			header.setHtml("");
111
						"	<span style='font-weight:bold;'>Condition d'accès :</span> {9}<br />"+