Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 917 → Rev 1023

/trunk/src/org/tela_botanica/client/composants/AproposFenetre.java/ParametreFenetre.java
1,11 → 1,18
package org.tela_botanica.client.composants;
 
import org.tela_botanica.client.ComposantClass;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.i18n.Constantes;
import org.tela_botanica.client.images.Images;
 
import com.extjs.gxt.ui.client.GXT;
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Version;
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.util.Format;
import com.extjs.gxt.ui.client.util.Params;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.HtmlContainer;
import com.extjs.gxt.ui.client.widget.TabItem;
import com.extjs.gxt.ui.client.widget.TabPanel;
import com.extjs.gxt.ui.client.widget.Window;
13,40 → 20,146
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.core.client.GWT;
 
public class ParametreFenetre extends Window {
 
public ParametreFenetre() {
public class AproposFenetre extends Window {
private Constantes i18nC = null;
private String aproposTpl = null;
private Params aproposParams = null;
private String contributeurTpl = null;
private Params contributeurParams = null;
public AproposFenetre() {
i18nC = Mediateur.i18nC;
setSize(500, 300);
setPlain(true);
setHeading("Paramêtres et préférences");
setIcon(Images.ICONES.application());
setHeading(i18nC.aproposTitre());
setIcon(Images.ICONES.information());
setLayout(new FitLayout());
TabPanel panneaux = new TabPanel();
panneaux.setBorders(false);
initialiserSquelettes();
initialiserParams();
TabItem aproposOnglet = new TabItem("À propos...");
aproposOnglet.setIcon(Images.ICONES.information());
aproposOnglet.addText("<h1>"+(String) Registry.get(RegistreId.APPLI_NOM)+"</h1>");
aproposOnglet.addText("Code : "+(String) Registry.get(RegistreId.APPLI_CODE));
aproposOnglet.addText("Version : "+(String) Registry.get(RegistreId.APPLI_VERSION));
aproposOnglet.addText("Révision : "+(String) Registry.get(RegistreId.APPLI_REVISION));
aproposOnglet.addText("<hr />");
aproposOnglet.addText("<h1>"+"Compilation"+"</h1>");
aproposOnglet.addText("Date : "+(String) Registry.get(RegistreId.APPLI_COMPILATION_DATE_HEURE));
aproposOnglet.addText("Version de Java : "+(String) Registry.get(RegistreId.APPLI_COMPILATION_JAVA_VERSION));
aproposOnglet.addText("<hr />");
aproposOnglet.addText("<h1>"+"Cadre de travail"+"</h1>");
aproposOnglet.addText("GWT : v"+GWT.getVersion());
Version gxtVersion = GXT.getVersion();
aproposOnglet.addText("GXT : v"+gxtVersion.getRelease());
aproposOnglet.addText("<hr />");
aproposOnglet.addText("<h1>"+"Navigateur"+"</h1>");
aproposOnglet.addText("COEL fonctionne actuellement dans : "+GXT.getUserAgent());
aproposOnglet.addStyleName("pad-text");
panneaux.add(aproposOnglet);
HtmlContainer aproposConteneurDuHtml = formaterSquelette(aproposTpl, aproposParams);
HtmlContainer contributeurConteneurDuHtml = formaterSquelette(contributeurTpl, contributeurParams);
add(panneaux, new FitData(4));
TabPanel aproposOnglets = new TabPanel();
TabItem aproposOnglet = new TabItem(i18nC.aproposTitre());
aproposOnglet.add(aproposConteneurDuHtml);
aproposOnglet.setBorders(false);
aproposOnglet.setScrollMode(Scroll.AUTO);
aproposOnglets.add(aproposOnglet);
TabItem contributeurOnglet = new TabItem(i18nC.aproposTitreContributeur());
contributeurOnglet.add(contributeurConteneurDuHtml);
contributeurOnglet.setBorders(false);
contributeurOnglet.setScrollMode(Scroll.AUTO);
aproposOnglets.add(contributeurOnglet);
add(aproposOnglets, new FitData(4));
}
 
private HtmlContainer formaterSquelette(String squelette, Params parametres) {
ajouterParametreParDefaut(parametres);
String html = Format.substitute(squelette, parametres);
HtmlContainer conteneurDuHtml = new HtmlContainer(html);
return conteneurDuHtml;
}
private void ajouterParametreParDefaut(Params parametres) {
parametres.set("css_label", ComposantClass.LABEL);
parametres.set("css_corps", ComposantClass.DETAIL_CORPS_CONTENU);
parametres.set("label_separateur", " :");
}
private void initialiserSquelettes() {
initialiserSqueletteApropos();
initialiserSqueletteContributeur();
}
private void initialiserSqueletteApropos() {
aproposTpl =
"<div class='{css_corps}'>"+
" <h2>{appli_nom}</h2>"+
" <p>"+
" <span class='{css_label}'>{i18n_code}{label_separateur}</span> {code}<br />"+
" <span class='{css_label}'>{i18n_version}{label_separateur}</span> {version}<br />"+
" <span class='{css_label}'>{i18n_revision}{label_separateur}</span> {revision}<br />"+
" <span class='{css_label}'>{i18n_licence}{label_separateur}</span> {licence}"+
" </p>"+
" <hr />"+
" <h2>{i18n_titre_compilation}</h2>"+
" <p>"+
" <span class='{css_label}'>{i18n_compilation_date}{label_separateur}</span> {compilation_date}<br />"+
" <span class='{css_label}'>{i18n_version_java}{label_separateur}</span> {version_java}"+
" </p>"+
" <hr />"+
" <h2>{i18n_titre_framework}</h2>"+
" <p>"+
" <span class='{css_label}'>{i18n_gwt}{label_separateur}</span> {gwt}<br />"+
" <span class='{css_label}'>{i18n_gxt}{label_separateur}</span> {gxt}"+
" </p>"+
" <hr />"+
" <h2>{i18n_titre_navigateur}</h2>"+
" <p>"+
" <span class='{css_label}'>{i18n_navigateur}{label_separateur}</span> {navigateur}<br />"+
" </p>"+
"</div>";
}
private void initialiserSqueletteContributeur() {
contributeurTpl =
"<div class='{css_corps}'>"+
" <h2>{i18n_titre_contributeur}</h2>"+
" <p>"+
" <span class='{css_label}'>{i18n_developpeur}{label_separateur}</span> {developpeur}<br />"+
" <span class='{css_label}'>{i18n_traducteur}{label_separateur}</span> {traducteur}<br />"+
" </p>"+
"</div>";
}
private void initialiserParams() {
initialiserParamApropos();
initialiserParamContributeur();
}
private void initialiserParamApropos() {
aproposParams = new Params();
aproposParams.set("i18n_code", i18nC.aproposCode());
aproposParams.set("i18n_version", i18nC.aproposVersion());
aproposParams.set("i18n_revision", i18nC.aproposRevision());
aproposParams.set("i18n_licence", i18nC.aproposLicence());
aproposParams.set("i18n_titre_compilation", i18nC.aproposTitreCompilation());
aproposParams.set("i18n_compilation_date", i18nC.aproposCompilationDate());
aproposParams.set("i18n_version_java", i18nC.aproposVersionJava());
aproposParams.set("i18n_titre_framework", i18nC.aproposTitreFramework());
aproposParams.set("i18n_gwt", i18nC.aproposGwt());
aproposParams.set("i18n_gxt", i18nC.aproposGxt());
aproposParams.set("i18n_titre_navigateur", i18nC.aproposTitreNavigateur());
aproposParams.set("i18n_navigateur", i18nC.aproposNavigateur());
aproposParams.set("appli_nom", (String) Registry.get(RegistreId.APPLI_NOM));
aproposParams.set("code", (String) Registry.get(RegistreId.APPLI_CODE));
aproposParams.set("version", (String) Registry.get(RegistreId.APPLI_VERSION));
aproposParams.set("revision", (String) Registry.get(RegistreId.APPLI_REVISION));
aproposParams.set("licence", (String) Registry.get(RegistreId.APPLI_LICENCE));
aproposParams.set("compilation_date", (String) Registry.get(RegistreId.APPLI_COMPILATION_DATE_HEURE));
aproposParams.set("version_java", (String) Registry.get(RegistreId.APPLI_COMPILATION_JAVA_VERSION));
aproposParams.set("gwt", GWT.getVersion());
aproposParams.set("gxt", GXT.getVersion().getRelease());
aproposParams.set("navigateur", GXT.getUserAgent());
}
private void initialiserParamContributeur() {
contributeurParams = new Params();
contributeurParams.set("i18n_titre_contributeur", i18nC.aproposTitreContributeur());
contributeurParams.set("i18n_developpeur", i18nC.aproposDeveloppeur());
contributeurParams.set("i18n_traducteur", i18nC.aproposTraducteur());
contributeurParams.set("developpeur", (String) Registry.get(RegistreId.APPLI_DEVELOPPEURS));
contributeurParams.set("traducteur", (String) Registry.get(RegistreId.APPLI_TRADUCTEURS));
}
}