| 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;
 | 
        
           | 1417 | jpm | 30 | 	private String licenceTpl = null;
 | 
        
           |  |  | 31 | 	private Params licenceParams = null;
 | 
        
           | 1023 | jpm | 32 |   | 
        
           |  |  | 33 | 	public AproposFenetre() {
 | 
        
           |  |  | 34 | 		i18nC = Mediateur.i18nC;
 | 
        
           |  |  | 35 |   | 
        
           | 1417 | jpm | 36 | 		setSize(600, 500);
 | 
        
           | 64 | jpm | 37 | 		setPlain(true);
 | 
        
           | 1023 | jpm | 38 | 		setHeading(i18nC.aproposTitre());
 | 
        
           |  |  | 39 | 		setIcon(Images.ICONES.information());
 | 
        
           | 64 | jpm | 40 | 		setLayout(new FitLayout());
 | 
        
           |  |  | 41 |   | 
        
           | 1023 | jpm | 42 | 		initialiserSquelettes();
 | 
        
           |  |  | 43 | 		initialiserParams();
 | 
        
           | 64 | jpm | 44 |   | 
        
           | 1023 | jpm | 45 | 		HtmlContainer aproposConteneurDuHtml = formaterSquelette(aproposTpl, aproposParams);
 | 
        
           |  |  | 46 | 		HtmlContainer contributeurConteneurDuHtml = formaterSquelette(contributeurTpl, contributeurParams);
 | 
        
           | 1417 | jpm | 47 | 		HtmlContainer licenceConteneurDuHtml = formaterSquelette(licenceTpl, licenceParams);
 | 
        
           | 66 | jpm | 48 |   | 
        
           | 1023 | jpm | 49 | 		TabPanel aproposOnglets = new TabPanel();
 | 
        
           |  |  | 50 |   | 
        
           |  |  | 51 | 		TabItem aproposOnglet = new TabItem(i18nC.aproposTitre());
 | 
        
           |  |  | 52 | 		aproposOnglet.add(aproposConteneurDuHtml);
 | 
        
           |  |  | 53 | 		aproposOnglet.setBorders(false);
 | 
        
           |  |  | 54 | 		aproposOnglet.setScrollMode(Scroll.AUTO);
 | 
        
           |  |  | 55 | 		aproposOnglets.add(aproposOnglet);
 | 
        
           |  |  | 56 |   | 
        
           |  |  | 57 | 		TabItem contributeurOnglet = new TabItem(i18nC.aproposTitreContributeur());
 | 
        
           |  |  | 58 | 		contributeurOnglet.add(contributeurConteneurDuHtml);
 | 
        
           |  |  | 59 | 		contributeurOnglet.setBorders(false);
 | 
        
           |  |  | 60 | 		contributeurOnglet.setScrollMode(Scroll.AUTO);
 | 
        
           |  |  | 61 | 		aproposOnglets.add(contributeurOnglet);
 | 
        
           |  |  | 62 |   | 
        
           | 1417 | jpm | 63 | 		TabItem licenceOnglet = new TabItem(i18nC.aproposTitreLicence());
 | 
        
           |  |  | 64 | 		licenceOnglet.add(licenceConteneurDuHtml);
 | 
        
           |  |  | 65 | 		licenceOnglet.setBorders(false);
 | 
        
           |  |  | 66 | 		licenceOnglet.setScrollMode(Scroll.AUTO);
 | 
        
           |  |  | 67 | 		aproposOnglets.add(licenceOnglet);
 | 
        
           |  |  | 68 |   | 
        
           | 1023 | jpm | 69 | 		add(aproposOnglets, new FitData(4));
 | 
        
           | 64 | jpm | 70 | 	}
 | 
        
           | 1023 | jpm | 71 |   | 
        
           |  |  | 72 | 	private HtmlContainer formaterSquelette(String squelette, Params parametres) {
 | 
        
           |  |  | 73 | 		ajouterParametreParDefaut(parametres);
 | 
        
           |  |  | 74 | 		String html = Format.substitute(squelette, parametres);
 | 
        
           |  |  | 75 | 		HtmlContainer conteneurDuHtml = new HtmlContainer(html);
 | 
        
           |  |  | 76 | 		return conteneurDuHtml;
 | 
        
           |  |  | 77 | 	}
 | 
        
           |  |  | 78 |   | 
        
           |  |  | 79 | 	private void ajouterParametreParDefaut(Params parametres) {
 | 
        
           |  |  | 80 | 		parametres.set("css_label", ComposantClass.LABEL);
 | 
        
           |  |  | 81 | 		parametres.set("css_corps", ComposantClass.DETAIL_CORPS_CONTENU);
 | 
        
           |  |  | 82 | 		parametres.set("label_separateur", " :");
 | 
        
           |  |  | 83 | 	}
 | 
        
           |  |  | 84 |   | 
        
           |  |  | 85 | 	private void initialiserSquelettes() {
 | 
        
           |  |  | 86 | 		initialiserSqueletteApropos();
 | 
        
           |  |  | 87 | 		initialiserSqueletteContributeur();
 | 
        
           | 1417 | jpm | 88 | 		initialiserSqueletteLicence();
 | 
        
           | 1023 | jpm | 89 | 	}
 | 
        
           |  |  | 90 |   | 
        
           |  |  | 91 | 	private void initialiserSqueletteApropos() {
 | 
        
           |  |  | 92 | 		aproposTpl =
 | 
        
           |  |  | 93 | 			"<div class='{css_corps}'>"+
 | 
        
           |  |  | 94 | 			"	<h2>{appli_nom}</h2>"+
 | 
        
           |  |  | 95 | 			"	<p>"+
 | 
        
           |  |  | 96 | 			"		<span class='{css_label}'>{i18n_code}{label_separateur}</span> {code}<br />"+
 | 
        
           |  |  | 97 | 			"		<span class='{css_label}'>{i18n_version}{label_separateur}</span> {version}<br />"+
 | 
        
           | 1108 | jpm | 98 | 			"		<span class='{css_label}'>{i18n_version_nom}{label_separateur}</span> {version_nom}<br />"+
 | 
        
           | 1023 | jpm | 99 | 			"		<span class='{css_label}'>{i18n_revision}{label_separateur}</span> {revision}<br />"+
 | 
        
           | 1417 | jpm | 100 | 			"		<span class='{css_label}'>{i18n_revision_jrest}{label_separateur}</span> {revision_jrest}<br />"+
 | 
        
           | 1023 | jpm | 101 | 			"		<span class='{css_label}'>{i18n_licence}{label_separateur}</span> {licence}"+
 | 
        
           |  |  | 102 | 			"	</p>"+
 | 
        
           |  |  | 103 | 			"	<hr />"+
 | 
        
           |  |  | 104 | 			"	<h2>{i18n_titre_compilation}</h2>"+
 | 
        
           |  |  | 105 | 			"	<p>"+
 | 
        
           |  |  | 106 | 			"		<span class='{css_label}'>{i18n_compilation_date}{label_separateur}</span> {compilation_date}<br />"+
 | 
        
           |  |  | 107 | 			"		<span class='{css_label}'>{i18n_version_java}{label_separateur}</span> {version_java}"+
 | 
        
           |  |  | 108 | 			"	</p>"+
 | 
        
           |  |  | 109 | 			"	<hr />"+
 | 
        
           |  |  | 110 | 			"	<h2>{i18n_titre_framework}</h2>"+
 | 
        
           |  |  | 111 | 			"	<p>"+
 | 
        
           |  |  | 112 | 			"		<span class='{css_label}'>{i18n_gwt}{label_separateur}</span> {gwt}<br />"+
 | 
        
           |  |  | 113 | 			"		<span class='{css_label}'>{i18n_gxt}{label_separateur}</span> {gxt}"+
 | 
        
           |  |  | 114 | 			"	</p>"+
 | 
        
           |  |  | 115 | 			"	<hr />"+
 | 
        
           |  |  | 116 | 			"	<h2>{i18n_titre_navigateur}</h2>"+
 | 
        
           |  |  | 117 | 			"	<p>"+
 | 
        
           |  |  | 118 | 			"		<span class='{css_label}'>{i18n_navigateur}{label_separateur}</span> {navigateur}<br />"+
 | 
        
           |  |  | 119 | 			"	</p>"+
 | 
        
           |  |  | 120 | 			"</div>";
 | 
        
           |  |  | 121 | 	}
 | 
        
           |  |  | 122 |   | 
        
           |  |  | 123 | 	private void initialiserSqueletteContributeur() {
 | 
        
           |  |  | 124 | 		contributeurTpl =
 | 
        
           |  |  | 125 | 			"<div class='{css_corps}'>"+
 | 
        
           |  |  | 126 | 			"	<h2>{i18n_titre_contributeur}</h2>"+
 | 
        
           |  |  | 127 | 			"	<p>"+
 | 
        
           |  |  | 128 | 			"		<span class='{css_label}'>{i18n_developpeur}{label_separateur}</span> {developpeur}<br />"+
 | 
        
           |  |  | 129 | 			"		<span class='{css_label}'>{i18n_traducteur}{label_separateur}</span> {traducteur}<br />"+
 | 
        
           | 1417 | jpm | 130 | 			"		<span class='{css_label}'>{i18n_testeur}{label_separateur}</span> {testeur}"+
 | 
        
           | 1023 | jpm | 131 | 			"	</p>"+
 | 
        
           |  |  | 132 | 			"</div>";
 | 
        
           |  |  | 133 | 	}
 | 
        
           |  |  | 134 |   | 
        
           | 1417 | jpm | 135 | 	private void initialiserSqueletteLicence() {
 | 
        
           |  |  | 136 | 		licenceTpl =
 | 
        
           |  |  | 137 | 			"<div class='{css_corps}'>"+
 | 
        
           |  |  | 138 | 			"	<h2>{i18n_titre_licence}</h2>"+
 | 
        
           |  |  | 139 | 			"	<div>{licence}</div>"+
 | 
        
           |  |  | 140 | 			"</div>";
 | 
        
           |  |  | 141 | 	}
 | 
        
           |  |  | 142 |   | 
        
           | 1023 | jpm | 143 | 	private void initialiserParams() {
 | 
        
           |  |  | 144 | 		initialiserParamApropos();
 | 
        
           |  |  | 145 | 		initialiserParamContributeur();
 | 
        
           | 1417 | jpm | 146 | 		initialiserParamLicence();
 | 
        
           | 1023 | jpm | 147 | 	}
 | 
        
           |  |  | 148 |   | 
        
           |  |  | 149 | 	private void initialiserParamApropos() {
 | 
        
           |  |  | 150 | 		aproposParams = new Params();
 | 
        
           |  |  | 151 |   | 
        
           |  |  | 152 | 		aproposParams.set("i18n_code", i18nC.aproposCode());
 | 
        
           |  |  | 153 | 		aproposParams.set("i18n_version", i18nC.aproposVersion());
 | 
        
           | 1108 | jpm | 154 | 		aproposParams.set("i18n_version_nom", i18nC.aproposVersionNom());
 | 
        
           | 1023 | jpm | 155 | 		aproposParams.set("i18n_revision", i18nC.aproposRevision());
 | 
        
           | 1417 | jpm | 156 | 		aproposParams.set("i18n_revision_jrest", i18nC.aproposRevisionJrest());
 | 
        
           | 1023 | jpm | 157 | 		aproposParams.set("i18n_licence", i18nC.aproposLicence());
 | 
        
           |  |  | 158 | 		aproposParams.set("i18n_titre_compilation", i18nC.aproposTitreCompilation());
 | 
        
           |  |  | 159 | 		aproposParams.set("i18n_compilation_date", i18nC.aproposCompilationDate());
 | 
        
           |  |  | 160 | 		aproposParams.set("i18n_version_java", i18nC.aproposVersionJava());
 | 
        
           |  |  | 161 | 		aproposParams.set("i18n_titre_framework", i18nC.aproposTitreFramework());
 | 
        
           |  |  | 162 | 		aproposParams.set("i18n_gwt", i18nC.aproposGwt());
 | 
        
           |  |  | 163 | 		aproposParams.set("i18n_gxt", i18nC.aproposGxt());
 | 
        
           |  |  | 164 | 		aproposParams.set("i18n_titre_navigateur", i18nC.aproposTitreNavigateur());
 | 
        
           |  |  | 165 | 		aproposParams.set("i18n_navigateur", i18nC.aproposNavigateur());
 | 
        
           |  |  | 166 |   | 
        
           |  |  | 167 | 		aproposParams.set("appli_nom", (String) Registry.get(RegistreId.APPLI_NOM));
 | 
        
           |  |  | 168 | 		aproposParams.set("code", (String) Registry.get(RegistreId.APPLI_CODE));
 | 
        
           |  |  | 169 | 		aproposParams.set("version", (String) Registry.get(RegistreId.APPLI_VERSION));
 | 
        
           | 1108 | jpm | 170 | 		aproposParams.set("version_nom", (String) Registry.get(RegistreId.APPLI_VERSION_NOM));
 | 
        
           | 1023 | jpm | 171 | 		aproposParams.set("revision", (String) Registry.get(RegistreId.APPLI_REVISION));
 | 
        
           | 1417 | jpm | 172 | 		aproposParams.set("revision_jrest", (String) Registry.get(RegistreId.JREST_REVISION));
 | 
        
           | 1023 | jpm | 173 | 		aproposParams.set("licence", (String) Registry.get(RegistreId.APPLI_LICENCE));
 | 
        
           |  |  | 174 | 		aproposParams.set("compilation_date", (String) Registry.get(RegistreId.APPLI_COMPILATION_DATE_HEURE));
 | 
        
           |  |  | 175 | 		aproposParams.set("version_java", (String) Registry.get(RegistreId.APPLI_COMPILATION_JAVA_VERSION));
 | 
        
           |  |  | 176 | 		aproposParams.set("gwt", GWT.getVersion());
 | 
        
           |  |  | 177 | 		aproposParams.set("gxt", GXT.getVersion().getRelease());
 | 
        
           |  |  | 178 | 		aproposParams.set("navigateur", GXT.getUserAgent());
 | 
        
           |  |  | 179 | 	}
 | 
        
           |  |  | 180 |   | 
        
           |  |  | 181 | 	private void initialiserParamContributeur() {
 | 
        
           |  |  | 182 | 		contributeurParams = new Params();
 | 
        
           |  |  | 183 |   | 
        
           |  |  | 184 | 		contributeurParams.set("i18n_titre_contributeur", i18nC.aproposTitreContributeur());
 | 
        
           |  |  | 185 | 		contributeurParams.set("i18n_developpeur", i18nC.aproposDeveloppeur());
 | 
        
           |  |  | 186 | 		contributeurParams.set("i18n_traducteur", i18nC.aproposTraducteur());
 | 
        
           | 1417 | jpm | 187 | 		contributeurParams.set("i18n_testeur", i18nC.aproposTesteur());
 | 
        
           | 1023 | jpm | 188 |   | 
        
           |  |  | 189 | 		contributeurParams.set("developpeur", (String) Registry.get(RegistreId.APPLI_DEVELOPPEURS));
 | 
        
           |  |  | 190 | 		contributeurParams.set("traducteur", (String) Registry.get(RegistreId.APPLI_TRADUCTEURS));
 | 
        
           | 1417 | jpm | 191 | 		contributeurParams.set("testeur", (String) Registry.get(RegistreId.APPLI_TESTEURS));
 | 
        
           | 1023 | jpm | 192 | 	}
 | 
        
           | 1417 | jpm | 193 |   | 
        
           |  |  | 194 | 	private void initialiserParamLicence() {
 | 
        
           |  |  | 195 | 		licenceParams = new Params();
 | 
        
           |  |  | 196 |   | 
        
           |  |  | 197 | 		licenceParams.set("i18n_titre_licence", i18nC.aproposTitreLicence());
 | 
        
           |  |  | 198 |   | 
        
           |  |  | 199 | 		licenceParams.set("licence", i18nC.licence());
 | 
        
           |  |  | 200 | 	}
 | 
        
           | 64 | jpm | 201 | }
 |