64 |
jpm |
1 |
package org.tela_botanica.client.composants;
|
|
|
2 |
|
1023 |
jpm |
3 |
import org.tela_botanica.client.ComposantClass;
|
|
|
4 |
import org.tela_botanica.client.Mediateur;
|
64 |
jpm |
5 |
import org.tela_botanica.client.RegistreId;
|
1023 |
jpm |
6 |
import org.tela_botanica.client.i18n.Constantes;
|
516 |
jp_milcent |
7 |
import org.tela_botanica.client.images.Images;
|
64 |
jpm |
8 |
|
66 |
jpm |
9 |
import com.extjs.gxt.ui.client.GXT;
|
64 |
jpm |
10 |
import com.extjs.gxt.ui.client.Registry;
|
1023 |
jpm |
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;
|
|
|
14 |
import com.extjs.gxt.ui.client.widget.ContentPanel;
|
|
|
15 |
import com.extjs.gxt.ui.client.widget.HtmlContainer;
|
64 |
jpm |
16 |
import com.extjs.gxt.ui.client.widget.TabItem;
|
|
|
17 |
import com.extjs.gxt.ui.client.widget.TabPanel;
|
|
|
18 |
import com.extjs.gxt.ui.client.widget.Window;
|
|
|
19 |
import com.extjs.gxt.ui.client.widget.layout.FitData;
|
|
|
20 |
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
|
|
21 |
import com.google.gwt.core.client.GWT;
|
|
|
22 |
|
1023 |
jpm |
23 |
public class AproposFenetre extends Window {
|
|
|
24 |
|
|
|
25 |
private Constantes i18nC = null;
|
|
|
26 |
private String aproposTpl = null;
|
|
|
27 |
private Params aproposParams = null;
|
|
|
28 |
private String contributeurTpl = null;
|
|
|
29 |
private Params contributeurParams = null;
|
|
|
30 |
|
|
|
31 |
public AproposFenetre() {
|
|
|
32 |
i18nC = Mediateur.i18nC;
|
|
|
33 |
|
64 |
jpm |
34 |
setSize(500, 300);
|
|
|
35 |
setPlain(true);
|
1023 |
jpm |
36 |
setHeading(i18nC.aproposTitre());
|
|
|
37 |
setIcon(Images.ICONES.information());
|
64 |
jpm |
38 |
setLayout(new FitLayout());
|
|
|
39 |
|
1023 |
jpm |
40 |
initialiserSquelettes();
|
|
|
41 |
initialiserParams();
|
64 |
jpm |
42 |
|
1023 |
jpm |
43 |
HtmlContainer aproposConteneurDuHtml = formaterSquelette(aproposTpl, aproposParams);
|
|
|
44 |
HtmlContainer contributeurConteneurDuHtml = formaterSquelette(contributeurTpl, contributeurParams);
|
66 |
jpm |
45 |
|
1023 |
jpm |
46 |
TabPanel aproposOnglets = new TabPanel();
|
|
|
47 |
|
|
|
48 |
TabItem aproposOnglet = new TabItem(i18nC.aproposTitre());
|
|
|
49 |
aproposOnglet.add(aproposConteneurDuHtml);
|
|
|
50 |
aproposOnglet.setBorders(false);
|
|
|
51 |
aproposOnglet.setScrollMode(Scroll.AUTO);
|
|
|
52 |
aproposOnglets.add(aproposOnglet);
|
|
|
53 |
|
|
|
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));
|
64 |
jpm |
61 |
}
|
1023 |
jpm |
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 />"+
|
1108 |
jpm |
88 |
" <span class='{css_label}'>{i18n_version_nom}{label_separateur}</span> {version_nom}<br />"+
|
1023 |
jpm |
89 |
" <span class='{css_label}'>{i18n_revision}{label_separateur}</span> {revision}<br />"+
|
|
|
90 |
" <span class='{css_label}'>{i18n_licence}{label_separateur}</span> {licence}"+
|
|
|
91 |
" </p>"+
|
|
|
92 |
" <hr />"+
|
|
|
93 |
" <h2>{i18n_titre_compilation}</h2>"+
|
|
|
94 |
" <p>"+
|
|
|
95 |
" <span class='{css_label}'>{i18n_compilation_date}{label_separateur}</span> {compilation_date}<br />"+
|
|
|
96 |
" <span class='{css_label}'>{i18n_version_java}{label_separateur}</span> {version_java}"+
|
|
|
97 |
" </p>"+
|
|
|
98 |
" <hr />"+
|
|
|
99 |
" <h2>{i18n_titre_framework}</h2>"+
|
|
|
100 |
" <p>"+
|
|
|
101 |
" <span class='{css_label}'>{i18n_gwt}{label_separateur}</span> {gwt}<br />"+
|
|
|
102 |
" <span class='{css_label}'>{i18n_gxt}{label_separateur}</span> {gxt}"+
|
|
|
103 |
" </p>"+
|
|
|
104 |
" <hr />"+
|
|
|
105 |
" <h2>{i18n_titre_navigateur}</h2>"+
|
|
|
106 |
" <p>"+
|
|
|
107 |
" <span class='{css_label}'>{i18n_navigateur}{label_separateur}</span> {navigateur}<br />"+
|
|
|
108 |
" </p>"+
|
|
|
109 |
"</div>";
|
|
|
110 |
}
|
|
|
111 |
|
|
|
112 |
private void initialiserSqueletteContributeur() {
|
|
|
113 |
contributeurTpl =
|
|
|
114 |
"<div class='{css_corps}'>"+
|
|
|
115 |
" <h2>{i18n_titre_contributeur}</h2>"+
|
|
|
116 |
" <p>"+
|
|
|
117 |
" <span class='{css_label}'>{i18n_developpeur}{label_separateur}</span> {developpeur}<br />"+
|
|
|
118 |
" <span class='{css_label}'>{i18n_traducteur}{label_separateur}</span> {traducteur}<br />"+
|
|
|
119 |
" </p>"+
|
|
|
120 |
"</div>";
|
|
|
121 |
}
|
|
|
122 |
|
|
|
123 |
private void initialiserParams() {
|
|
|
124 |
initialiserParamApropos();
|
|
|
125 |
initialiserParamContributeur();
|
|
|
126 |
}
|
|
|
127 |
|
|
|
128 |
private void initialiserParamApropos() {
|
|
|
129 |
aproposParams = new Params();
|
|
|
130 |
|
|
|
131 |
aproposParams.set("i18n_code", i18nC.aproposCode());
|
|
|
132 |
aproposParams.set("i18n_version", i18nC.aproposVersion());
|
1108 |
jpm |
133 |
aproposParams.set("i18n_version_nom", i18nC.aproposVersionNom());
|
1023 |
jpm |
134 |
aproposParams.set("i18n_revision", i18nC.aproposRevision());
|
|
|
135 |
aproposParams.set("i18n_licence", i18nC.aproposLicence());
|
|
|
136 |
aproposParams.set("i18n_titre_compilation", i18nC.aproposTitreCompilation());
|
|
|
137 |
aproposParams.set("i18n_compilation_date", i18nC.aproposCompilationDate());
|
|
|
138 |
aproposParams.set("i18n_version_java", i18nC.aproposVersionJava());
|
|
|
139 |
aproposParams.set("i18n_titre_framework", i18nC.aproposTitreFramework());
|
|
|
140 |
aproposParams.set("i18n_gwt", i18nC.aproposGwt());
|
|
|
141 |
aproposParams.set("i18n_gxt", i18nC.aproposGxt());
|
|
|
142 |
aproposParams.set("i18n_titre_navigateur", i18nC.aproposTitreNavigateur());
|
|
|
143 |
aproposParams.set("i18n_navigateur", i18nC.aproposNavigateur());
|
|
|
144 |
|
|
|
145 |
aproposParams.set("appli_nom", (String) Registry.get(RegistreId.APPLI_NOM));
|
|
|
146 |
aproposParams.set("code", (String) Registry.get(RegistreId.APPLI_CODE));
|
|
|
147 |
aproposParams.set("version", (String) Registry.get(RegistreId.APPLI_VERSION));
|
1108 |
jpm |
148 |
aproposParams.set("version_nom", (String) Registry.get(RegistreId.APPLI_VERSION_NOM));
|
1023 |
jpm |
149 |
aproposParams.set("revision", (String) Registry.get(RegistreId.APPLI_REVISION));
|
|
|
150 |
aproposParams.set("licence", (String) Registry.get(RegistreId.APPLI_LICENCE));
|
|
|
151 |
aproposParams.set("compilation_date", (String) Registry.get(RegistreId.APPLI_COMPILATION_DATE_HEURE));
|
|
|
152 |
aproposParams.set("version_java", (String) Registry.get(RegistreId.APPLI_COMPILATION_JAVA_VERSION));
|
|
|
153 |
aproposParams.set("gwt", GWT.getVersion());
|
|
|
154 |
aproposParams.set("gxt", GXT.getVersion().getRelease());
|
|
|
155 |
aproposParams.set("navigateur", GXT.getUserAgent());
|
|
|
156 |
}
|
|
|
157 |
|
|
|
158 |
private void initialiserParamContributeur() {
|
|
|
159 |
contributeurParams = new Params();
|
|
|
160 |
|
|
|
161 |
contributeurParams.set("i18n_titre_contributeur", i18nC.aproposTitreContributeur());
|
|
|
162 |
contributeurParams.set("i18n_developpeur", i18nC.aproposDeveloppeur());
|
|
|
163 |
contributeurParams.set("i18n_traducteur", i18nC.aproposTraducteur());
|
|
|
164 |
|
|
|
165 |
contributeurParams.set("developpeur", (String) Registry.get(RegistreId.APPLI_DEVELOPPEURS));
|
|
|
166 |
contributeurParams.set("traducteur", (String) Registry.get(RegistreId.APPLI_TRADUCTEURS));
|
|
|
167 |
}
|
64 |
jpm |
168 |
}
|