Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 373 Rev 374
Line 1... Line 1...
1
package org.tela_botanica.client.vues;
1
package org.tela_botanica.client.vues;
Line 2... Line 2...
2
 
2
 
3
import org.tela_botanica.client.ComposantId;
3
import org.tela_botanica.client.ComposantId;
4
import org.tela_botanica.client.Mediateur;
-
 
5
import org.tela_botanica.client.RegistreId;
4
import org.tela_botanica.client.Mediateur;
6
import org.tela_botanica.client.interfaces.Rafraichissable;
5
import org.tela_botanica.client.interfaces.Rafraichissable;
Line 7... Line 6...
7
import org.tela_botanica.client.modeles.Structure;
6
import org.tela_botanica.client.modeles.Structure;
8
 
7
 
9
import com.extjs.gxt.ui.client.Registry;
8
import com.extjs.gxt.ui.client.Events;
10
import com.extjs.gxt.ui.client.Style.Scroll;
9
import com.extjs.gxt.ui.client.Style.Scroll;
11
import com.extjs.gxt.ui.client.util.Format;
10
import com.extjs.gxt.ui.client.util.Format;
-
 
11
import com.extjs.gxt.ui.client.util.Params;
-
 
12
import com.extjs.gxt.ui.client.widget.ContentPanel;
12
import com.extjs.gxt.ui.client.util.Params;
13
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
13
import com.extjs.gxt.ui.client.widget.ContentPanel;
14
import com.extjs.gxt.ui.client.widget.Html;
14
import com.extjs.gxt.ui.client.widget.HtmlContainer;
15
import com.extjs.gxt.ui.client.widget.HtmlContainer;
15
import com.extjs.gxt.ui.client.widget.LayoutContainer;
16
import com.extjs.gxt.ui.client.widget.LayoutContainer;
16
import com.extjs.gxt.ui.client.widget.TabItem;
17
import com.extjs.gxt.ui.client.widget.TabItem;
-
 
18
import com.extjs.gxt.ui.client.widget.TabPanel;
17
import com.extjs.gxt.ui.client.widget.TabPanel;
19
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
Line 18... Line 20...
18
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
20
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
Line 19... Line 21...
19
import com.google.gwt.core.client.GWT;
21
import com.google.gwt.core.client.GWT;
Line 20... Line 22...
20
 
22
 
21
public class StructureDetailPanneauVue extends LayoutContainer implements Rafraichissable {
23
public class StructureDetailPanneauVue extends LayoutContainer implements Rafraichissable {
Line 22... Line 24...
22
 
24
 
Line 23... Line 25...
23
	private Mediateur mediateur = null;
25
	private Mediateur mediateur = null;
24
	
26
	
25
	private String enteteHTML = "<div class='coel-detail'><h1>{0}</h1><h2>{1}</h2></div>";
27
	private String enteteTpl = null;
26
	private String contenuHTML = null;
28
	private String contenuTpl = null;
Line 27... Line 29...
27
	
29
	
28
	private Structure structure = null;
30
	private Structure structure = null;
29
	
-
 
30
	private ContentPanel panneauPrincipal = null;
31
	
31
	private HtmlContainer entete = null;
32
	private ContentPanel panneauPrincipal = null;
Line 32... Line 33...
32
	private TabPanel onglets = null;
33
	private Html entete = null;
33
	private TabItem identificationOnglet = null;
34
	private TabPanel onglets = null;
34
 
35
	private TabItem identificationOnglet = null;
Line 35... Line 36...
35
	public StructureDetailPanneauVue(Mediateur mediateurCourant) {
36
 
-
 
37
	public StructureDetailPanneauVue(Mediateur mediateurCourant) {
-
 
38
		mediateur = mediateurCourant;
-
 
39
		initialiserEnteteHtmlTpl();
Line 36... Line -...
36
		mediateur = mediateurCourant;
-
 
Line 37... Line 40...
37
		Registry.register(RegistreId.PANNEAU_INSTITUTION_DETAIL, this);
40
		initialiserContenuHtmlTpl();
38
		initialiserEnteteHtmlTpl();
41
		
39
		initialiserContenuHtmlTpl();
42
		setLayout(new FitLayout());
Line -... Line 43...
-
 
43
		setBorders(false);
-
 
44
		setScrollMode(Scroll.AUTO);
-
 
45
		
-
 
46
		panneauPrincipal = new ContentPanel();
-
 
47
		panneauPrincipal.setLayout(new FlowLayout());
40
		
48
		panneauPrincipal.setHeaderVisible(false);
41
		setLayout(new FitLayout());
49
		panneauPrincipal.setBodyBorder(false);
Line 42... Line -...
42
		setBorders(false);
-
 
43
		setScrollMode(Scroll.AUTO);
50
		
44
		
51
		
45
		panneauPrincipal = new ContentPanel();
52
	    entete = new Html();
Line 46... Line 53...
46
		
53
	    entete.setId(ComposantId.ZONE_DETAIL);
47
		entete = new HtmlContainer();
-
 
48
		
54
	    panneauPrincipal.setTopComponent(entete);
49
		onglets = new TabPanel();
55
		
Line 50... Line 56...
50
		onglets.setAutoHeight(true);
56
		onglets = new TabPanel();
51
		onglets.setAutoWidth(true);
57
		onglets.setHeight("100%");
52
		
58
		onglets.setBorders(false);
53
		identificationOnglet = new TabItem("Général");
59
		onglets.setBodyBorder(false);
54
		onglets.add(identificationOnglet);
60
 
Line 55... Line 61...
55
		
61
		identificationOnglet = new TabItem("Général");
56
		panneauPrincipal.add(entete);
62
		onglets.add(identificationOnglet);
57
		panneauPrincipal.add(onglets);
63
		
58
		add(panneauPrincipal);
64
		panneauPrincipal.add(onglets);
59
	}
65
		add(panneauPrincipal);
Line 60... Line 66...
60
 
66
	}
61
	private void afficherDetailInstitution(Structure structureCourante) {
67
 
62
		removeAll();
68
	private void afficherDetailInstitution(Structure structureCourante) {
Line 63... Line 69...
63
		if (structureCourante != null) {
69
		if (structureCourante != null) {
64
			structure = structureCourante;
70
			structure = structureCourante;
Line 91... Line 97...
91
		contenuParams.add(structure.getFax());
97
		contenuParams.add(structure.getFax());
92
		contenuParams.add(structure.getCourriel());
98
		contenuParams.add(structure.getCourriel());
93
		contenuParams.add(structure.getConditionAcces());
99
		contenuParams.add(structure.getConditionAcces());
94
		contenuParams.add(ComposantId.ZONE_DETAIL_CORPS);
100
		contenuParams.add(ComposantId.ZONE_DETAIL_CORPS);
Line 95... Line 101...
95
 
101
 
96
		String cHtml = Format.substitute(contenuHTML, contenuParams);
102
		String cHtml = Format.substitute(contenuTpl, contenuParams);
-
 
103
		HtmlContainer corpsConteneurDuHtml = new HtmlContainer(cHtml);
97
		HtmlContainer corpsConteneurDuHtml = new HtmlContainer(cHtml);
104
		identificationOnglet.removeAll();
98
		identificationOnglet.add(corpsConteneurDuHtml);
105
		identificationOnglet.add(corpsConteneurDuHtml);
Line 99... Line 106...
99
	}
106
	}
100
	
107
	
101
	private void initialiserEnteteHtmlTpl() {
108
	private void initialiserEnteteHtmlTpl() {
102
		enteteHTML = 	"<div id='{0}'>"+
109
		enteteTpl = 	"<div id='{0}'>"+
103
						"	<h1>{1}</h1>"+
110
						"	<h1>{1}</h1>"+
104
						"	<h2>{2}</h2>" +
111
						"	<h2>{2}</h2>" +
Line 105... Line 112...
105
						"</div>";
112
						"</div>";
106
	}
113
	}
107
	
114
	
108
	private void initialiserContenuHtmlTpl() {
115
	private void initialiserContenuHtmlTpl() {
109
		contenuHTML = 	"<div id='{10}'>"+
116
		contenuTpl = 	"<div id='{10}'>"+
110
						"	<h2>Renseignements administratifs</h2>"+
117
						"	<h2>Renseignements administratifs</h2>"+
111
						"	<span style='font-weight:bold;'>Condition d'accès :</span> {9}<br />"+
118
						"	<span style='font-weight:bold;'>Condition d'accès :</span> {9}<br />"+