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 />"+
|
|
|
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 |
|
|
|
158 |
contributeurParams.set("i18n_titre_contributeur", i18nC.aproposTitreContributeur());
|
|
|
159 |
contributeurParams.set("i18n_developpeur", i18nC.aproposDeveloppeur());
|
|
|
160 |
contributeurParams.set("i18n_traducteur", i18nC.aproposTraducteur());
|
|
|
161 |
|
|
|
162 |
contributeurParams.set("developpeur", (String) Registry.get(RegistreId.APPLI_DEVELOPPEURS));
|
|
|
163 |
contributeurParams.set("traducteur", (String) Registry.get(RegistreId.APPLI_TRADUCTEURS));
|
|
|
164 |
}
|
64 |
jpm |
165 |
}
|