Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 917 Rev 1023
Line 1... Line 1...
1
package org.tela_botanica.client.composants;
1
package org.tela_botanica.client.composants;
Line -... Line 2...
-
 
2
 
-
 
3
import org.tela_botanica.client.ComposantClass;
2
 
4
import org.tela_botanica.client.Mediateur;
-
 
5
import org.tela_botanica.client.RegistreId;
3
import org.tela_botanica.client.RegistreId;
6
import org.tela_botanica.client.i18n.Constantes;
Line 4... Line 7...
4
import org.tela_botanica.client.images.Images;
7
import org.tela_botanica.client.images.Images;
5
 
8
 
6
import com.extjs.gxt.ui.client.GXT;
9
import com.extjs.gxt.ui.client.GXT;
-
 
10
import com.extjs.gxt.ui.client.Registry;
-
 
11
import com.extjs.gxt.ui.client.Style.Scroll;
-
 
12
import com.extjs.gxt.ui.client.util.Format;
-
 
13
import com.extjs.gxt.ui.client.util.Params;
7
import com.extjs.gxt.ui.client.Registry;
14
import com.extjs.gxt.ui.client.widget.ContentPanel;
8
import com.extjs.gxt.ui.client.Version;
15
import com.extjs.gxt.ui.client.widget.HtmlContainer;
9
import com.extjs.gxt.ui.client.widget.TabItem;
16
import com.extjs.gxt.ui.client.widget.TabItem;
10
import com.extjs.gxt.ui.client.widget.TabPanel;
17
import com.extjs.gxt.ui.client.widget.TabPanel;
11
import com.extjs.gxt.ui.client.widget.Window;
18
import com.extjs.gxt.ui.client.widget.Window;
12
import com.extjs.gxt.ui.client.widget.layout.FitData;
19
import com.extjs.gxt.ui.client.widget.layout.FitData;
Line 13... Line 20...
13
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
20
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
-
 
21
import com.google.gwt.core.client.GWT;
-
 
22
 
-
 
23
public class AproposFenetre extends Window {
-
 
24
	
-
 
25
	private Constantes i18nC = null;
-
 
26
	private String aproposTpl = null;
14
import com.google.gwt.core.client.GWT;
27
	private Params aproposParams = null;
15
 
28
	private String contributeurTpl = null;
-
 
29
	private Params contributeurParams = null;
-
 
30
	
16
public class ParametreFenetre extends Window {
31
	public AproposFenetre() {
17
 
32
		i18nC = Mediateur.i18nC;
18
	public ParametreFenetre() {
33
		
19
		setSize(500, 300);
34
		setSize(500, 300);
20
		setPlain(true);
35
		setPlain(true);
Line -... Line 36...
-
 
36
		setHeading(i18nC.aproposTitre());
-
 
37
		setIcon(Images.ICONES.information());
-
 
38
		setLayout(new FitLayout());
-
 
39
		
-
 
40
		initialiserSquelettes();
-
 
41
		initialiserParams();
21
		setHeading("Paramêtres et préférences");
42
		
-
 
43
		HtmlContainer aproposConteneurDuHtml = formaterSquelette(aproposTpl, aproposParams);
-
 
44
		HtmlContainer contributeurConteneurDuHtml = formaterSquelette(contributeurTpl, contributeurParams);
-
 
45
		
22
		setIcon(Images.ICONES.application());
46
		TabPanel aproposOnglets = new TabPanel();
-
 
47
		
-
 
48
		TabItem aproposOnglet = new TabItem(i18nC.aproposTitre());
Line 23... Line 49...
23
		setLayout(new FitLayout());
49
		aproposOnglet.add(aproposConteneurDuHtml);
24
		
50
		aproposOnglet.setBorders(false);
25
		TabPanel panneaux = new TabPanel();
-
 
26
		panneaux.setBorders(false);
-
 
27
		
-
 
28
		TabItem aproposOnglet = new TabItem("À propos...");
-
 
29
		aproposOnglet.setIcon(Images.ICONES.information());
51
		aproposOnglet.setScrollMode(Scroll.AUTO);
30
		aproposOnglet.addText("<h1>"+(String) Registry.get(RegistreId.APPLI_NOM)+"</h1>");
52
		aproposOnglets.add(aproposOnglet);
31
		aproposOnglet.addText("Code : "+(String) Registry.get(RegistreId.APPLI_CODE));
-
 
32
		aproposOnglet.addText("Version : "+(String) Registry.get(RegistreId.APPLI_VERSION));
-
 
33
		aproposOnglet.addText("Révision : "+(String) Registry.get(RegistreId.APPLI_REVISION));
-
 
34
		aproposOnglet.addText("<hr />");
-
 
35
		aproposOnglet.addText("<h1>"+"Compilation"+"</h1>");
-
 
36
		aproposOnglet.addText("Date : "+(String) Registry.get(RegistreId.APPLI_COMPILATION_DATE_HEURE));
-
 
37
		aproposOnglet.addText("Version de Java : "+(String) Registry.get(RegistreId.APPLI_COMPILATION_JAVA_VERSION));
-
 
38
		aproposOnglet.addText("<hr />");
53
		
39
		aproposOnglet.addText("<h1>"+"Cadre de travail"+"</h1>");
-
 
40
		aproposOnglet.addText("GWT : v"+GWT.getVersion());
-
 
41
		Version gxtVersion = GXT.getVersion();
-
 
42
		aproposOnglet.addText("GXT : v"+gxtVersion.getRelease());
-
 
Line 43... Line 54...
43
		aproposOnglet.addText("<hr />");
54
		TabItem contributeurOnglet = new TabItem(i18nC.aproposTitreContributeur());
-
 
55
		contributeurOnglet.add(contributeurConteneurDuHtml);
-
 
56
		contributeurOnglet.setBorders(false);
-
 
57
		contributeurOnglet.setScrollMode(Scroll.AUTO);
-
 
58
		aproposOnglets.add(contributeurOnglet);
-
 
59
		
-
 
60
		add(aproposOnglets, new FitData(4));
-
 
61
	}
-
 
62
	
-
 
63
	private HtmlContainer formaterSquelette(String squelette, Params parametres) {
-
 
64
		ajouterParametreParDefaut(parametres);
-
 
65
		String html = Format.substitute(squelette, parametres);
-
 
66
		HtmlContainer conteneurDuHtml = new HtmlContainer(html);
-
 
67
		return conteneurDuHtml;
-
 
68
	}
-
 
69
	
-
 
70
	private void ajouterParametreParDefaut(Params parametres) {
-
 
71
		parametres.set("css_label", ComposantClass.LABEL);
-
 
72
		parametres.set("css_corps", ComposantClass.DETAIL_CORPS_CONTENU);
-
 
73
		parametres.set("label_separateur", " :");
-
 
74
	}
-
 
75
	
-
 
76
	private void initialiserSquelettes() {
-
 
77
		initialiserSqueletteApropos();
-
 
78
		initialiserSqueletteContributeur();
-
 
79
	}
-
 
80
	
-
 
81
	private void initialiserSqueletteApropos() {
-
 
82
		aproposTpl = 
-
 
83
			"<div class='{css_corps}'>"+
-
 
84
			"	<h2>{appli_nom}</h2>"+
-
 
85
			"	<p>"+
-
 
86
			"		<span class='{css_label}'>{i18n_code}{label_separateur}</span> {code}<br />"+
-
 
87
			"		<span class='{css_label}'>{i18n_version}{label_separateur}</span> {version}<br />"+
-
 
88
			"		<span class='{css_label}'>{i18n_revision}{label_separateur}</span> {revision}<br />"+
-
 
89
			"		<span class='{css_label}'>{i18n_licence}{label_separateur}</span> {licence}"+
-
 
90
			"	</p>"+
-
 
91
			"	<hr />"+
-
 
92
			"	<h2>{i18n_titre_compilation}</h2>"+
-
 
93
			"	<p>"+
-
 
94
			"		<span class='{css_label}'>{i18n_compilation_date}{label_separateur}</span> {compilation_date}<br />"+
-
 
95
			"		<span class='{css_label}'>{i18n_version_java}{label_separateur}</span> {version_java}"+
-
 
96
			"	</p>"+
-
 
97
			"	<hr />"+
-
 
98
			"	<h2>{i18n_titre_framework}</h2>"+
-
 
99
			"	<p>"+
-
 
100
			"		<span class='{css_label}'>{i18n_gwt}{label_separateur}</span> {gwt}<br />"+
-
 
101
			"		<span class='{css_label}'>{i18n_gxt}{label_separateur}</span> {gxt}"+
-
 
102
			"	</p>"+
-
 
103
			"	<hr />"+
-
 
104
			"	<h2>{i18n_titre_navigateur}</h2>"+
-
 
105
			"	<p>"+
-
 
106
			"		<span class='{css_label}'>{i18n_navigateur}{label_separateur}</span> {navigateur}<br />"+
-
 
107
			"	</p>"+
-
 
108
			"</div>";
-
 
109
	}
-
 
110
	
-
 
111
	private void initialiserSqueletteContributeur() {
-
 
112
		contributeurTpl = 
-
 
113
			"<div class='{css_corps}'>"+
-
 
114
			"	<h2>{i18n_titre_contributeur}</h2>"+
-
 
115
			"	<p>"+
-
 
116
			"		<span class='{css_label}'>{i18n_developpeur}{label_separateur}</span> {developpeur}<br />"+
-
 
117
			"		<span class='{css_label}'>{i18n_traducteur}{label_separateur}</span> {traducteur}<br />"+
-
 
118
			"	</p>"+
-
 
119
			"</div>";
-
 
120
	}
-
 
121
	
-
 
122
	private void initialiserParams() {
-
 
123
		initialiserParamApropos();
-
 
124
		initialiserParamContributeur();
-
 
125
	}
-
 
126
	
-
 
127
	private void initialiserParamApropos() {
-
 
128
		aproposParams = new Params();
-
 
129
		
-
 
130
		aproposParams.set("i18n_code", i18nC.aproposCode());
-
 
131
		aproposParams.set("i18n_version", i18nC.aproposVersion());
-
 
132
		aproposParams.set("i18n_revision", i18nC.aproposRevision());
-
 
133
		aproposParams.set("i18n_licence", i18nC.aproposLicence());
-
 
134
		aproposParams.set("i18n_titre_compilation", i18nC.aproposTitreCompilation());
-
 
135
		aproposParams.set("i18n_compilation_date", i18nC.aproposCompilationDate());
-
 
136
		aproposParams.set("i18n_version_java", i18nC.aproposVersionJava());
-
 
137
		aproposParams.set("i18n_titre_framework", i18nC.aproposTitreFramework());
-
 
138
		aproposParams.set("i18n_gwt", i18nC.aproposGwt());
-
 
139
		aproposParams.set("i18n_gxt", i18nC.aproposGxt());
-
 
140
		aproposParams.set("i18n_titre_navigateur", i18nC.aproposTitreNavigateur());
-
 
141
		aproposParams.set("i18n_navigateur", i18nC.aproposNavigateur());
-
 
142
		
-
 
143
		aproposParams.set("appli_nom", (String) Registry.get(RegistreId.APPLI_NOM));
-
 
144
		aproposParams.set("code", (String) Registry.get(RegistreId.APPLI_CODE));
-
 
145
		aproposParams.set("version", (String) Registry.get(RegistreId.APPLI_VERSION));
-
 
146
		aproposParams.set("revision", (String) Registry.get(RegistreId.APPLI_REVISION));
-
 
147
		aproposParams.set("licence", (String) Registry.get(RegistreId.APPLI_LICENCE));
-
 
148
		aproposParams.set("compilation_date", (String) Registry.get(RegistreId.APPLI_COMPILATION_DATE_HEURE));
-
 
149
		aproposParams.set("version_java", (String) Registry.get(RegistreId.APPLI_COMPILATION_JAVA_VERSION));
-
 
150
		aproposParams.set("gwt", GWT.getVersion());
-
 
151
		aproposParams.set("gxt", GXT.getVersion().getRelease());
-
 
152
		aproposParams.set("navigateur", GXT.getUserAgent());
-
 
153
	}
-
 
154
	
-
 
155
	private void initialiserParamContributeur() {
-
 
156
		contributeurParams = new Params();
-
 
157
		
44
		aproposOnglet.addText("<h1>"+"Navigateur"+"</h1>");
158
		contributeurParams.set("i18n_titre_contributeur", i18nC.aproposTitreContributeur());
45
		aproposOnglet.addText("COEL fonctionne actuellement dans : "+GXT.getUserAgent());
-
 
46
		aproposOnglet.addStyleName("pad-text");
159
		contributeurParams.set("i18n_developpeur", i18nC.aproposDeveloppeur());
47
		panneaux.add(aproposOnglet);
160
		contributeurParams.set("i18n_traducteur", i18nC.aproposTraducteur());