16,7 → 16,6 |
|
import com.extjs.gxt.ui.client.Registry; |
import com.extjs.gxt.ui.client.Style.HorizontalAlignment; |
import com.extjs.gxt.ui.client.event.ComponentEvent; |
import com.extjs.gxt.ui.client.event.SelectionChangedEvent; |
import com.extjs.gxt.ui.client.event.SelectionChangedListener; |
import com.extjs.gxt.ui.client.event.SelectionListener; |
27,6 → 26,8 |
import com.extjs.gxt.ui.client.widget.TabItem; |
import com.extjs.gxt.ui.client.widget.TabPanel; |
import com.extjs.gxt.ui.client.widget.button.Button; |
import com.extjs.gxt.ui.client.widget.form.CheckBox; |
import com.extjs.gxt.ui.client.widget.form.CheckBoxGroup; |
import com.extjs.gxt.ui.client.widget.form.ComboBox; |
import com.extjs.gxt.ui.client.widget.form.DateField; |
import com.extjs.gxt.ui.client.widget.form.FieldSet; |
48,6 → 49,7 |
import com.extjs.gxt.ui.client.widget.layout.FlowLayout; |
import com.extjs.gxt.ui.client.widget.layout.FormData; |
import com.extjs.gxt.ui.client.widget.layout.FormLayout; |
import com.extjs.gxt.ui.client.widget.layout.LayoutData; |
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem; |
import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem; |
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar; |
70,9 → 72,15 |
private TextField<String> ihChp = null; |
private TextField<String> mnhnChp = null; |
private ComboBox<InterneValeur> comboTypeStructure = null; |
private TabItem personnelOnglet = null; |
private EditorGrid<Personne> grillePersonnel = null; |
private ListStore<Personne> personnelGrilleMagazin = null; |
private LabelField nbreTotalPersonnelChp = null; |
private TabItem conservationOnglet = null; |
private CheckBoxGroup trukLocalStockageCacGrpChp = null; |
private ContentPanel trukLocalStockageCp = null; |
private CheckBoxGroup trukMeubleStockageCacGrpChp = null; |
private ContentPanel trukMeubleStockageCp = null; |
|
public FormStructureVue() { |
//+-----------------------------------------------------------------------------------------------------------+ |
325,27 → 333,16 |
principalFdTelMail.setLayout(new ColumnLayout()); |
|
LayoutContainer gaucheFdTelMail = new LayoutContainer(); |
layoutGauche = new FormLayout(); |
layoutGauche.setLabelAlign(LabelAlign.LEFT); |
layoutGauche.setLabelWidth(100); |
layoutGauche.setPadding(0); |
gaucheFdTelMail.setLayout(layoutGauche); |
gaucheFdTelMail.setLayout(creerFormLayout(100, LabelAlign.LEFT, 0)); |
|
LayoutContainer droiteFdTelMail = new LayoutContainer(); |
layoutDroite = new FormLayout(); |
layoutDroite.setLabelAlign(LabelAlign.LEFT); |
layoutDroite.setLabelWidth(100); |
layoutDroite.setPadding(0); |
droiteFdTelMail.setLayout(layoutDroite); |
droiteFdTelMail.setLayout(creerFormLayout(100, LabelAlign.LEFT, 0)); |
|
FieldSet fieldSetTelMail = new FieldSet(); |
fieldSetTelMail.setHeading("Communication"); |
fieldSetTelMail.setCollapsible(true); |
|
layoutFieldset = new FormLayout(); |
layoutFieldset.setLabelWidth(200); |
layoutFieldset.setPadding(4); |
fieldSetTelMail.setLayout(layoutFieldset); |
fieldSetTelMail.setLayout(creerFormLayout(200, LabelAlign.LEFT, 4)); |
|
TextField<String> telChp = new TextField<String>(); |
telChp.setFieldLabel("Téléphone"); |
377,13 → 374,9 |
|
//+-----------------------------------------------------------------------------------------------------------+ |
// Onlget formulaire CONSERVATION |
TabItem conservationOnglet = new TabItem(); |
conservationOnglet.setText("Conservation"); |
conservationOnglet.setLayout(new FormLayout()); |
onglets.add(creerOngletConservation()); |
onglets.setSelection(conservationOnglet); |
|
|
onglets.add(conservationOnglet); |
|
//+-----------------------------------------------------------------------------------------------------------+ |
// Onlget formulaire VALORISATION |
TabItem valorisationOnglet = new TabItem(); |
409,8 → 402,55 |
add(panel); |
} |
|
private TabItem creerOngletConservation() { |
conservationOnglet = new TabItem(); |
conservationOnglet.setText("Conservation"); |
conservationOnglet.setLayout(creerFormLayout(650, LabelAlign.TOP, null)); |
|
CheckBoxGroup markFormationCacGrpChp = new CheckBoxGroup(); |
CheckBox ouiMarkFormationCac = new CheckBox(); |
ouiMarkFormationCac.setBoxLabel("Oui"); |
CheckBox nonMarkFormationCac = new CheckBox(); |
nonMarkFormationCac.setBoxLabel("Non"); |
markFormationCacGrpChp.setFieldLabel("Le personnel s'occupant des collections a-t-il suivi des formations en conservations ?"); |
markFormationCacGrpChp.add(ouiMarkFormationCac); |
markFormationCacGrpChp.add(nonMarkFormationCac); |
conservationOnglet.add(markFormationCacGrpChp); |
|
TextField<String> formationChp = new TextField<String>(); |
formationChp.setFieldLabel("Lesquelles ?"); |
conservationOnglet.add(formationChp); |
|
CheckBoxGroup markInteretFormationCacGrpChp = new CheckBoxGroup(); |
CheckBox ouiMarkInteretFormationCac = new CheckBox(); |
ouiMarkInteretFormationCac.setBoxLabel("Oui"); |
CheckBox nonMarkInteretFormationCac = new CheckBox(); |
nonMarkInteretFormationCac.setBoxLabel("Non"); |
markInteretFormationCacGrpChp.setFieldLabel("Seriez vous intéressé par une formation à la conservation et à la restauration d'herbier ?"); |
markInteretFormationCacGrpChp.add(ouiMarkInteretFormationCac); |
markInteretFormationCacGrpChp.add(nonMarkInteretFormationCac); |
conservationOnglet.add(markInteretFormationCacGrpChp); |
|
coelModele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("localStockage")); |
trukLocalStockageCp = new ContentPanel(); |
trukLocalStockageCp.setLayout(creerFormLayout(650, LabelAlign.TOP, 0)); |
trukLocalStockageCp.setWidth(800); |
trukLocalStockageCp.setHeaderVisible(false); |
conservationOnglet.add(trukLocalStockageCp); |
|
coelModele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("meubleStockage")); |
trukMeubleStockageCp = new ContentPanel(); |
trukMeubleStockageCp.setLayout(creerFormLayout(650, LabelAlign.TOP, 0)); |
trukMeubleStockageCp.setWidth(800); |
trukMeubleStockageCp.setHeaderVisible(false); |
conservationOnglet.add(trukMeubleStockageCp); |
|
return conservationOnglet; |
} |
|
|
private TabItem creerOngletPersonnel() { |
TabItem personnelOnglet = new TabItem(); |
personnelOnglet = new TabItem(); |
personnelOnglet.setText("Personnel"); |
FormLayout personnelOngletLayout = new FormLayout(); |
personnelOngletLayout.setLabelWidth(400); |
623,6 → 663,23 |
return cp; |
} |
|
/** Méthode simplifiant la création de FormLayout. |
* |
* @param labelWidth largeur des labels |
* @param labelAlign alignement des labels |
* @param padding padding du layout |
* @return |
*/ |
private FormLayout creerFormLayout(Integer labelWidth, LabelAlign labelAlign, Integer padding) { |
FormLayout formLayout = new FormLayout(); |
formLayout.setLabelWidth(labelWidth); |
formLayout.setLabelAlign(labelAlign); |
if (padding != null) { |
formLayout.setPadding(padding); |
} |
return formLayout; |
} |
|
public void rafraichir(Object nouvelleDonnees) { |
if (nouvelleDonnees instanceof ValeurListe) { |
ValeurListe listeValeurs = (ValeurListe) nouvelleDonnees; |
654,6 → 711,65 |
magazinLiFonction.add(liste); |
comboLiFonction.setStore(magazinLiFonction); |
} |
if (listeValeurs.getId().equals(config.getListeId("localStockage"))) { |
trukLocalStockageCacGrpChp = new CheckBoxGroup(); |
trukLocalStockageCacGrpChp.setFieldLabel("Avez vous des locaux spécifiques de stockage des collections botaniques ?"); |
for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) { |
String nom = listeValeurs.get(it.next()).get("nom"); |
CheckBox trukLocalStockageCac = new CheckBox(); |
// Calcul de la largeur de la checkbox en fonction de la taille du label |
int largeur = nom.length()*10; |
if (nom.length() > 20) { |
largeur = 170; |
} |
trukLocalStockageCac.setWidth(largeur); |
trukLocalStockageCac.setBoxLabel(nom); |
trukLocalStockageCacGrpChp.add(trukLocalStockageCac); |
} |
trukLocalStockageCp.add(trukLocalStockageCacGrpChp); |
|
ContentPanel autreCp = new ContentPanel(); |
autreCp.setLayout(creerFormLayout(75, LabelAlign.TOP, 0)); |
autreCp.setHeaderVisible(false); |
TextField<String> autreTrukLocalStockageChp = new TextField<String>(); |
autreTrukLocalStockageChp.setFieldLabel("Autre"); |
autreTrukLocalStockageChp.setLabelStyle("font-weight:normal;"); |
autreTrukLocalStockageChp.setWidth(300); |
autreCp.add(autreTrukLocalStockageChp); |
trukLocalStockageCp.add(autreCp); |
|
trukLocalStockageCp.layout(); |
} |
if (listeValeurs.getId().equals(config.getListeId("meubleStockage"))) { |
trukMeubleStockageCacGrpChp = new CheckBoxGroup(); |
trukMeubleStockageCacGrpChp.setFieldLabel("Avez vous des meubles spécifiques au stockage des collections botaniques ?"); |
for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) { |
String nom = listeValeurs.get(it.next()).get("nom"); |
CheckBox trukMeubleStockageCac = new CheckBox(); |
GWT.log("Taille : "+nom.length(), null); |
// Calcul de la largeur de la checkbox en fonction de la taille du label |
int largeur = nom.length()*8; |
if (nom.length() > 20) { |
largeur = 170; |
} |
trukMeubleStockageCac.setWidth(largeur); |
trukMeubleStockageCac.setBoxLabel(nom); |
trukMeubleStockageCacGrpChp.add(trukMeubleStockageCac); |
} |
trukMeubleStockageCp.add(trukMeubleStockageCacGrpChp); |
|
ContentPanel autreCp = new ContentPanel(); |
autreCp.setLayout(creerFormLayout(75, LabelAlign.TOP, 0)); |
autreCp.setHeaderVisible(false); |
TextField<String> autreTrukLocalStockageChp = new TextField<String>(); |
autreTrukLocalStockageChp.setFieldLabel("Autre"); |
autreTrukLocalStockageChp.setLabelStyle("font-weight:normal;"); |
autreTrukLocalStockageChp.setWidth(300); |
autreCp.add(autreTrukLocalStockageChp); |
trukMeubleStockageCp.add(autreCp); |
|
trukMeubleStockageCp.layout(); |
} |
GWT.log("La liste #"+listeValeurs.getId()+" a été reçue!", null); |
} else { |
GWT.log("La liste #"+listeValeurs.getId()+" ne contient aucune valeurs!", null); |