1 |
package org.tela_botanica.client.vues;
|
1 |
package org.tela_botanica.client.vues;
|
2 |
|
2 |
|
3 |
import java.util.ArrayList;
|
3 |
import java.util.ArrayList;
|
4 |
import java.util.Iterator;
|
4 |
import java.util.Iterator;
|
5 |
import java.util.List;
|
5 |
import java.util.List;
|
6 |
|
6 |
|
7 |
import org.tela_botanica.client.Modele;
|
7 |
import org.tela_botanica.client.Modele;
|
8 |
import org.tela_botanica.client.RegistreId;
|
8 |
import org.tela_botanica.client.RegistreId;
|
9 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
9 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
10 |
import org.tela_botanica.client.modeles.Configuration;
|
10 |
import org.tela_botanica.client.modeles.Configuration;
|
11 |
import org.tela_botanica.client.modeles.InterneValeur;
|
11 |
import org.tela_botanica.client.modeles.InterneValeur;
|
12 |
import org.tela_botanica.client.modeles.InterneValeurListe;
|
12 |
import org.tela_botanica.client.modeles.InterneValeurListe;
|
13 |
import org.tela_botanica.client.modeles.Personne;
|
13 |
import org.tela_botanica.client.modeles.Personne;
|
14 |
import org.tela_botanica.client.modeles.Valeur;
|
14 |
import org.tela_botanica.client.modeles.Valeur;
|
15 |
import org.tela_botanica.client.modeles.ValeurListe;
|
15 |
import org.tela_botanica.client.modeles.ValeurListe;
|
16 |
|
16 |
|
17 |
import com.extjs.gxt.ui.client.Registry;
|
17 |
import com.extjs.gxt.ui.client.Registry;
|
18 |
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
|
18 |
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
|
19 |
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
|
19 |
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
|
20 |
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
|
20 |
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
|
21 |
import com.extjs.gxt.ui.client.event.SelectionListener;
|
21 |
import com.extjs.gxt.ui.client.event.SelectionListener;
|
22 |
import com.extjs.gxt.ui.client.event.ToolBarEvent;
|
22 |
import com.extjs.gxt.ui.client.event.ToolBarEvent;
|
23 |
import com.extjs.gxt.ui.client.store.ListStore;
|
23 |
import com.extjs.gxt.ui.client.store.ListStore;
|
24 |
import com.extjs.gxt.ui.client.widget.ContentPanel;
|
24 |
import com.extjs.gxt.ui.client.widget.ContentPanel;
|
25 |
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
25 |
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
26 |
import com.extjs.gxt.ui.client.widget.TabItem;
|
26 |
import com.extjs.gxt.ui.client.widget.TabItem;
|
27 |
import com.extjs.gxt.ui.client.widget.TabPanel;
|
27 |
import com.extjs.gxt.ui.client.widget.TabPanel;
|
28 |
import com.extjs.gxt.ui.client.widget.button.Button;
|
28 |
import com.extjs.gxt.ui.client.widget.button.Button;
|
29 |
import com.extjs.gxt.ui.client.widget.form.CheckBox;
|
29 |
import com.extjs.gxt.ui.client.widget.form.CheckBox;
|
30 |
import com.extjs.gxt.ui.client.widget.form.CheckBoxGroup;
|
30 |
import com.extjs.gxt.ui.client.widget.form.CheckBoxGroup;
|
31 |
import com.extjs.gxt.ui.client.widget.form.ComboBox;
|
31 |
import com.extjs.gxt.ui.client.widget.form.ComboBox;
|
32 |
import com.extjs.gxt.ui.client.widget.form.DateField;
|
32 |
import com.extjs.gxt.ui.client.widget.form.DateField;
|
33 |
import com.extjs.gxt.ui.client.widget.form.FieldSet;
|
33 |
import com.extjs.gxt.ui.client.widget.form.FieldSet;
|
34 |
import com.extjs.gxt.ui.client.widget.form.FormPanel;
|
34 |
import com.extjs.gxt.ui.client.widget.form.FormPanel;
|
35 |
import com.extjs.gxt.ui.client.widget.form.LabelField;
|
35 |
import com.extjs.gxt.ui.client.widget.form.LabelField;
|
36 |
import com.extjs.gxt.ui.client.widget.form.NumberField;
|
36 |
import com.extjs.gxt.ui.client.widget.form.NumberField;
|
- |
|
37 |
import com.extjs.gxt.ui.client.widget.form.Radio;
|
- |
|
38 |
import com.extjs.gxt.ui.client.widget.form.RadioGroup;
|
37 |
import com.extjs.gxt.ui.client.widget.form.TextField;
|
39 |
import com.extjs.gxt.ui.client.widget.form.TextField;
|
38 |
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
|
40 |
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
|
39 |
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
|
41 |
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
|
40 |
import com.extjs.gxt.ui.client.widget.grid.CellEditor;
|
42 |
import com.extjs.gxt.ui.client.widget.grid.CellEditor;
|
41 |
import com.extjs.gxt.ui.client.widget.grid.CheckBoxSelectionModel;
|
43 |
import com.extjs.gxt.ui.client.widget.grid.CheckBoxSelectionModel;
|
42 |
import com.extjs.gxt.ui.client.widget.grid.CheckColumnConfig;
|
44 |
import com.extjs.gxt.ui.client.widget.grid.CheckColumnConfig;
|
43 |
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
|
45 |
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
|
44 |
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
|
46 |
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
|
45 |
import com.extjs.gxt.ui.client.widget.grid.EditorGrid;
|
47 |
import com.extjs.gxt.ui.client.widget.grid.EditorGrid;
|
46 |
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
|
48 |
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
|
47 |
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
|
49 |
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
|
48 |
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
50 |
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
49 |
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
|
51 |
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
|
50 |
import com.extjs.gxt.ui.client.widget.layout.FormData;
|
52 |
import com.extjs.gxt.ui.client.widget.layout.FormData;
|
51 |
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
|
53 |
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
|
52 |
import com.extjs.gxt.ui.client.widget.layout.LayoutData;
|
- |
|
53 |
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
|
54 |
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
|
54 |
import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem;
|
55 |
import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem;
|
55 |
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
56 |
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
56 |
import com.google.gwt.core.client.GWT;
|
57 |
import com.google.gwt.core.client.GWT;
|
57 |
import com.google.gwt.i18n.client.DateTimeFormat;
|
58 |
import com.google.gwt.i18n.client.DateTimeFormat;
|
58 |
import com.google.gwt.i18n.client.NumberFormat;
|
59 |
import com.google.gwt.i18n.client.NumberFormat;
|
59 |
|
60 |
|
60 |
public class FormStructureVue extends LayoutContainer implements Rafraichissable {
|
61 |
public class FormStructureVue extends LayoutContainer implements Rafraichissable {
|
61 |
|
62 |
|
62 |
private Modele coelModele = null ;
|
63 |
private Modele coelModele = null ;
|
63 |
private ListStore<Valeur> magazinLstpr = null;
|
64 |
private ListStore<Valeur> magazinLstpr = null;
|
64 |
private ComboBox<Valeur> comboLstpr = null;
|
65 |
private ComboBox<Valeur> comboLstpr = null;
|
65 |
private ListStore<Valeur> magazinLstpu = null;
|
66 |
private ListStore<Valeur> magazinLstpu = null;
|
66 |
private ComboBox<Valeur> comboLstpu = null;
|
67 |
private ComboBox<Valeur> comboLstpu = null;
|
67 |
private ListStore<Valeur> magazinLiStatut = null;
|
68 |
private ListStore<Valeur> magazinLiStatut = null;
|
68 |
private ComboBox<Valeur> comboLiStatut = null;
|
69 |
private ComboBox<Valeur> comboLiStatut = null;
|
69 |
private ListStore<Valeur> magazinLiFonction = null;
|
70 |
private ListStore<Valeur> magazinLiFonction = null;
|
70 |
private ComboBox<Valeur> comboLiFonction = null;
|
71 |
private ComboBox<Valeur> comboLiFonction = null;
|
71 |
private ComboBox<InterneValeur> comboAcronyme = null;
|
72 |
private ComboBox<InterneValeur> comboAcronyme = null;
|
72 |
private TextField<String> ihChp = null;
|
73 |
private TextField<String> ihChp = null;
|
73 |
private TextField<String> mnhnChp = null;
|
74 |
private TextField<String> mnhnChp = null;
|
74 |
private ComboBox<InterneValeur> comboTypeStructure = null;
|
75 |
private ComboBox<InterneValeur> comboTypeStructure = null;
|
75 |
private TabItem personnelOnglet = null;
|
76 |
private TabItem personnelOnglet = null;
|
76 |
private EditorGrid<Personne> grillePersonnel = null;
|
77 |
private EditorGrid<Personne> grillePersonnel = null;
|
77 |
private ListStore<Personne> personnelGrilleMagazin = null;
|
78 |
private ListStore<Personne> personnelGrilleMagazin = null;
|
78 |
private LabelField nbreTotalPersonnelChp = null;
|
79 |
private LabelField nbreTotalPersonnelChp = null;
|
79 |
private TabItem conservationOnglet = null;
|
80 |
private TabItem conservationOnglet = null;
|
80 |
private CheckBoxGroup trukLocalStockageCacGrpChp = null;
|
81 |
private CheckBoxGroup trukLocalStockageCacGrpChp = null;
|
81 |
private ContentPanel trukLocalStockageCp = null;
|
82 |
private ContentPanel trukLocalStockageCp = null;
|
82 |
private CheckBoxGroup trukMeubleStockageCacGrpChp = null;
|
83 |
private CheckBoxGroup trukMeubleStockageCacGrpChp = null;
|
83 |
private ContentPanel trukMeubleStockageCp = null;
|
84 |
private ContentPanel trukMeubleStockageCp = null;
|
- |
|
85 |
private CheckBoxGroup trukParametreStockageCacGrpChp = null;
|
- |
|
86 |
private ContentPanel trukParametreStockageCp = null;
|
84 |
|
87 |
|
85 |
public FormStructureVue() {
|
88 |
public FormStructureVue() {
|
86 |
//+-----------------------------------------------------------------------------------------------------------+
|
89 |
//+-----------------------------------------------------------------------------------------------------------+
|
87 |
// Initialisation de variables
|
90 |
// Initialisation de variables
|
88 |
setLayout(new FitLayout());
|
91 |
setLayout(new FitLayout());
|
89 |
coelModele = Registry.get(RegistreId.MODELE);
|
92 |
coelModele = Registry.get(RegistreId.MODELE);
|
90 |
|
93 |
|
91 |
// Création de la disposition : FIELDSET
|
94 |
// Création de la disposition : FIELDSET
|
92 |
FormLayout layoutFieldset = new FormLayout();
|
95 |
FormLayout layoutFieldset = new FormLayout();
|
93 |
layoutFieldset.setLabelWidth(200);
|
96 |
layoutFieldset.setLabelWidth(200);
|
94 |
layoutFieldset.setPadding(4);
|
97 |
layoutFieldset.setPadding(4);
|
95 |
|
98 |
|
96 |
//+-----------------------------------------------------------------------------------------------------------+
|
99 |
//+-----------------------------------------------------------------------------------------------------------+
|
97 |
// Création du panneau Formulaire
|
100 |
// Création du panneau Formulaire
|
98 |
FormPanel panel = new FormPanel();
|
101 |
FormPanel panel = new FormPanel();
|
99 |
panel.setFrame(true);
|
102 |
panel.setFrame(true);
|
100 |
panel.setIconStyle("icone-form-ajouter");
|
103 |
panel.setIconStyle("icone-form-ajouter");
|
101 |
panel.setCollapsible(false);
|
104 |
panel.setCollapsible(false);
|
102 |
panel.setHeading("Ajout d'une institution");
|
105 |
panel.setHeading("Ajout d'une institution");
|
103 |
panel.setButtonAlign(HorizontalAlignment.CENTER);
|
106 |
panel.setButtonAlign(HorizontalAlignment.CENTER);
|
104 |
panel.setLayout(new FlowLayout());
|
107 |
panel.setLayout(new FlowLayout());
|
105 |
|
108 |
|
106 |
// Création des onglets
|
109 |
// Création des onglets
|
107 |
TabPanel onglets = new TabPanel();
|
110 |
TabPanel onglets = new TabPanel();
|
108 |
onglets.setAutoHeight(true);
|
111 |
onglets.setAutoHeight(true);
|
109 |
//tabs.setDeferredRender(false);
|
112 |
//tabs.setDeferredRender(false);
|
110 |
|
113 |
|
111 |
//+-----------------------------------------------------------------------------------------------------------+
|
114 |
//+-----------------------------------------------------------------------------------------------------------+
|
112 |
// Onlget formulaire IDENTIFICATION
|
115 |
// Onlget formulaire IDENTIFICATION
|
113 |
TabItem identificationOnglet = new TabItem();
|
116 |
TabItem identificationOnglet = new TabItem();
|
114 |
identificationOnglet.setText("Identification");
|
117 |
identificationOnglet.setText("Identification");
|
115 |
identificationOnglet.setLayout(new FormLayout());
|
118 |
identificationOnglet.setLayout(new FormLayout());
|
116 |
|
119 |
|
117 |
// Fieldset IDENTITÉ
|
120 |
// Fieldset IDENTITÉ
|
118 |
FieldSet fieldSetIdentite = new FieldSet();
|
121 |
FieldSet fieldSetIdentite = new FieldSet();
|
119 |
fieldSetIdentite.setHeading("Identité");
|
122 |
fieldSetIdentite.setHeading("Identité");
|
120 |
fieldSetIdentite.setCollapsible(true);
|
123 |
fieldSetIdentite.setCollapsible(true);
|
121 |
fieldSetIdentite.setLayout(layoutFieldset);
|
124 |
fieldSetIdentite.setLayout(layoutFieldset);
|
122 |
|
125 |
|
123 |
TextField<String> nomStructureChp = new TextField<String>();
|
126 |
TextField<String> nomStructureChp = new TextField<String>();
|
124 |
nomStructureChp.setFieldLabel("Nom de la structure");
|
127 |
nomStructureChp.setFieldLabel("Nom de la structure");
|
125 |
nomStructureChp.setAllowBlank(false);
|
128 |
nomStructureChp.setAllowBlank(false);
|
126 |
nomStructureChp.getMessages().setBlankText("Ce champ est obligatoire.");
|
129 |
nomStructureChp.getMessages().setBlankText("Ce champ est obligatoire.");
|
127 |
fieldSetIdentite.add(nomStructureChp, new FormData(450, 0));
|
130 |
fieldSetIdentite.add(nomStructureChp, new FormData(450, 0));
|
128 |
|
131 |
|
129 |
// Création du sous-formulaire : Acronyme
|
132 |
// Création du sous-formulaire : Acronyme
|
130 |
LayoutContainer ligne = new LayoutContainer();
|
133 |
LayoutContainer ligne = new LayoutContainer();
|
131 |
ligne.setLayout(new ColumnLayout());
|
134 |
ligne.setLayout(new ColumnLayout());
|
132 |
LayoutContainer gauche = new LayoutContainer();
|
135 |
LayoutContainer gauche = new LayoutContainer();
|
133 |
FormLayout layoutGauche = new FormLayout();
|
136 |
FormLayout layoutGauche = new FormLayout();
|
134 |
layoutGauche.setLabelAlign(LabelAlign.LEFT);
|
137 |
layoutGauche.setLabelAlign(LabelAlign.LEFT);
|
135 |
layoutGauche.setLabelWidth(200);
|
138 |
layoutGauche.setLabelWidth(200);
|
136 |
layoutGauche.setPadding(0);
|
139 |
layoutGauche.setPadding(0);
|
137 |
gauche.setLayout(layoutGauche);
|
140 |
gauche.setLayout(layoutGauche);
|
138 |
LayoutContainer droite = new LayoutContainer();
|
141 |
LayoutContainer droite = new LayoutContainer();
|
139 |
FormLayout layoutDroite = new FormLayout();
|
142 |
FormLayout layoutDroite = new FormLayout();
|
140 |
layoutDroite.setLabelWidth(0);
|
143 |
layoutDroite.setLabelWidth(0);
|
141 |
layoutDroite.setPadding(0);
|
144 |
layoutDroite.setPadding(0);
|
142 |
droite.setLayout(layoutDroite);
|
145 |
droite.setLayout(layoutDroite);
|
143 |
|
146 |
|
144 |
ListStore<InterneValeur> acronymes = new ListStore<InterneValeur>();
|
147 |
ListStore<InterneValeur> acronymes = new ListStore<InterneValeur>();
|
145 |
acronymes.add(InterneValeurListe.getTypeAcronyme());
|
148 |
acronymes.add(InterneValeurListe.getTypeAcronyme());
|
146 |
|
149 |
|
147 |
comboAcronyme = new ComboBox<InterneValeur>();
|
150 |
comboAcronyme = new ComboBox<InterneValeur>();
|
148 |
comboAcronyme.setEmptyText("Sélectioner un type d'acronyme...");
|
151 |
comboAcronyme.setEmptyText("Sélectioner un type d'acronyme...");
|
149 |
comboAcronyme.setFieldLabel("Acronymes");
|
152 |
comboAcronyme.setFieldLabel("Acronymes");
|
150 |
comboAcronyme.setDisplayField("nom");
|
153 |
comboAcronyme.setDisplayField("nom");
|
151 |
comboAcronyme.setStore(acronymes);
|
154 |
comboAcronyme.setStore(acronymes);
|
152 |
comboAcronyme.setEditable(false);
|
155 |
comboAcronyme.setEditable(false);
|
153 |
comboAcronyme.setTypeAhead(true);
|
156 |
comboAcronyme.setTypeAhead(true);
|
154 |
comboAcronyme.setTriggerAction(TriggerAction.ALL);
|
157 |
comboAcronyme.setTriggerAction(TriggerAction.ALL);
|
155 |
comboAcronyme.addSelectionChangedListener(new SelectionChangedListener<InterneValeur>() {
|
158 |
comboAcronyme.addSelectionChangedListener(new SelectionChangedListener<InterneValeur>() {
|
156 |
@Override
|
159 |
@Override
|
157 |
public void selectionChanged(SelectionChangedEvent<InterneValeur> se) {
|
160 |
public void selectionChanged(SelectionChangedEvent<InterneValeur> se) {
|
158 |
String acronymeAbr = se.getSelectedItem().getAbr();
|
161 |
String acronymeAbr = se.getSelectedItem().getAbr();
|
159 |
if (acronymeAbr.equals("IH")) {
|
162 |
if (acronymeAbr.equals("IH")) {
|
160 |
mnhnChp.hide();
|
163 |
mnhnChp.hide();
|
161 |
ihChp.show();
|
164 |
ihChp.show();
|
162 |
} else if (acronymeAbr.equals("MNHN")) {
|
165 |
} else if (acronymeAbr.equals("MNHN")) {
|
163 |
ihChp.hide();
|
166 |
ihChp.hide();
|
164 |
mnhnChp.show();
|
167 |
mnhnChp.show();
|
165 |
} else if (acronymeAbr.equals("")) {
|
168 |
} else if (acronymeAbr.equals("")) {
|
166 |
ihChp.hide();
|
169 |
ihChp.hide();
|
167 |
mnhnChp.hide();
|
170 |
mnhnChp.hide();
|
168 |
comboAcronyme.clearSelections();
|
171 |
comboAcronyme.clearSelections();
|
169 |
}
|
172 |
}
|
170 |
}
|
173 |
}
|
171 |
});
|
174 |
});
|
172 |
gauche.add(comboAcronyme);
|
175 |
gauche.add(comboAcronyme);
|
173 |
|
176 |
|
174 |
ihChp = new TextField<String>();
|
177 |
ihChp = new TextField<String>();
|
175 |
//ihChp.setEmptyText("Index Herbariorum");
|
178 |
//ihChp.setEmptyText("Index Herbariorum");
|
176 |
ihChp.setLabelSeparator("");
|
179 |
ihChp.setLabelSeparator("");
|
177 |
ihChp.setToolTip("Index Herbariorum : herbier de plus de 5000 échantillons");
|
180 |
ihChp.setToolTip("Index Herbariorum : herbier de plus de 5000 échantillons");
|
178 |
ihChp.hide();
|
181 |
ihChp.hide();
|
179 |
droite.add(ihChp);
|
182 |
droite.add(ihChp);
|
180 |
|
183 |
|
181 |
mnhnChp = new TextField<String>();
|
184 |
mnhnChp = new TextField<String>();
|
182 |
//mnhnChp.setEmptyText("MNHN");
|
185 |
//mnhnChp.setEmptyText("MNHN");
|
183 |
mnhnChp.setLabelSeparator("");
|
186 |
mnhnChp.setLabelSeparator("");
|
184 |
mnhnChp.setToolTip("Acronyme MNHN : herbier de moins de 5000 échantillons");
|
187 |
mnhnChp.setToolTip("Acronyme MNHN : herbier de moins de 5000 échantillons");
|
185 |
mnhnChp.hide();
|
188 |
mnhnChp.hide();
|
186 |
droite.add(mnhnChp);
|
189 |
droite.add(mnhnChp);
|
187 |
|
190 |
|
188 |
ligne.add(gauche, new ColumnData(0.5));
|
191 |
ligne.add(gauche, new ColumnData(0.5));
|
189 |
ligne.add(droite, new ColumnData(0.5));
|
192 |
ligne.add(droite, new ColumnData(0.5));
|
190 |
fieldSetIdentite.add(ligne);
|
193 |
fieldSetIdentite.add(ligne);
|
191 |
|
194 |
|
192 |
// Création du sous-formulaire : Type de Structure
|
195 |
// Création du sous-formulaire : Type de Structure
|
193 |
LayoutContainer ligneTs = new LayoutContainer();
|
196 |
LayoutContainer ligneTs = new LayoutContainer();
|
194 |
ligneTs.setLayout(new ColumnLayout());
|
197 |
ligneTs.setLayout(new ColumnLayout());
|
195 |
|
198 |
|
196 |
LayoutContainer gaucheTs = new LayoutContainer();
|
199 |
LayoutContainer gaucheTs = new LayoutContainer();
|
197 |
layoutGauche = new FormLayout();
|
200 |
layoutGauche = new FormLayout();
|
198 |
layoutGauche.setLabelAlign(LabelAlign.LEFT);
|
201 |
layoutGauche.setLabelAlign(LabelAlign.LEFT);
|
199 |
layoutGauche.setLabelWidth(200);
|
202 |
layoutGauche.setLabelWidth(200);
|
200 |
layoutGauche.setPadding(0);
|
203 |
layoutGauche.setPadding(0);
|
201 |
gaucheTs.setLayout(layoutGauche);
|
204 |
gaucheTs.setLayout(layoutGauche);
|
202 |
|
205 |
|
203 |
LayoutContainer droiteTs = new LayoutContainer();
|
206 |
LayoutContainer droiteTs = new LayoutContainer();
|
204 |
layoutDroite = new FormLayout();
|
207 |
layoutDroite = new FormLayout();
|
205 |
layoutDroite.setLabelWidth(0);
|
208 |
layoutDroite.setLabelWidth(0);
|
206 |
layoutDroite.setPadding(0);
|
209 |
layoutDroite.setPadding(0);
|
207 |
droiteTs.setLayout(layoutDroite);
|
210 |
droiteTs.setLayout(layoutDroite);
|
208 |
|
211 |
|
209 |
ListStore<InterneValeur> typesStructure = new ListStore<InterneValeur>();
|
212 |
ListStore<InterneValeur> typesStructure = new ListStore<InterneValeur>();
|
210 |
typesStructure.add(InterneValeurListe.getTypeStructure());
|
213 |
typesStructure.add(InterneValeurListe.getTypeStructure());
|
211 |
|
214 |
|
212 |
this.comboTypeStructure = new ComboBox<InterneValeur>();
|
215 |
this.comboTypeStructure = new ComboBox<InterneValeur>();
|
213 |
comboTypeStructure.setEmptyText("Sélectioner un type de structure...");
|
216 |
comboTypeStructure.setEmptyText("Sélectioner un type de structure...");
|
214 |
comboTypeStructure.setFieldLabel("Statut des structures");
|
217 |
comboTypeStructure.setFieldLabel("Statut des structures");
|
215 |
comboTypeStructure.setDisplayField("nom");
|
218 |
comboTypeStructure.setDisplayField("nom");
|
216 |
comboTypeStructure.setStore(typesStructure);
|
219 |
comboTypeStructure.setStore(typesStructure);
|
217 |
comboTypeStructure.setEditable(false);
|
220 |
comboTypeStructure.setEditable(false);
|
218 |
comboTypeStructure.setTypeAhead(true);
|
221 |
comboTypeStructure.setTypeAhead(true);
|
219 |
comboTypeStructure.setTriggerAction(TriggerAction.ALL);
|
222 |
comboTypeStructure.setTriggerAction(TriggerAction.ALL);
|
220 |
comboTypeStructure.addSelectionChangedListener(new SelectionChangedListener<InterneValeur>() {
|
223 |
comboTypeStructure.addSelectionChangedListener(new SelectionChangedListener<InterneValeur>() {
|
221 |
@Override
|
224 |
@Override
|
222 |
public void selectionChanged(SelectionChangedEvent<InterneValeur> se) {
|
225 |
public void selectionChanged(SelectionChangedEvent<InterneValeur> se) {
|
223 |
String typeAbr = se.getSelectedItem().getAbr();
|
226 |
String typeAbr = se.getSelectedItem().getAbr();
|
224 |
if (typeAbr.equals("stpu")) {
|
227 |
if (typeAbr.equals("stpu")) {
|
225 |
comboLstpr.hide();
|
228 |
comboLstpr.hide();
|
226 |
comboLstpu.show();
|
229 |
comboLstpu.show();
|
227 |
} else if (typeAbr.equals("stpr")) {
|
230 |
} else if (typeAbr.equals("stpr")) {
|
228 |
comboLstpu.hide();
|
231 |
comboLstpu.hide();
|
229 |
comboLstpr.show();
|
232 |
comboLstpr.show();
|
230 |
} else if (typeAbr.equals("")) {
|
233 |
} else if (typeAbr.equals("")) {
|
231 |
comboLstpr.hide();
|
234 |
comboLstpr.hide();
|
232 |
comboLstpu.hide();
|
235 |
comboLstpu.hide();
|
233 |
comboTypeStructure.clearSelections();
|
236 |
comboTypeStructure.clearSelections();
|
234 |
}
|
237 |
}
|
235 |
}
|
238 |
}
|
236 |
});
|
239 |
});
|
237 |
gaucheTs.add(comboTypeStructure);
|
240 |
gaucheTs.add(comboTypeStructure);
|
238 |
|
241 |
|
239 |
coelModele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("stpu"));
|
242 |
coelModele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("stpu"));
|
240 |
magazinLstpu = new ListStore<Valeur>();
|
243 |
magazinLstpu = new ListStore<Valeur>();
|
241 |
magazinLstpu.add(new ArrayList<Valeur>());
|
244 |
magazinLstpu.add(new ArrayList<Valeur>());
|
242 |
comboLstpu = new ComboBox<Valeur>();
|
245 |
comboLstpu = new ComboBox<Valeur>();
|
243 |
//comboLstpu.setFieldLabel("Statut des structures publiques");
|
246 |
//comboLstpu.setFieldLabel("Statut des structures publiques");
|
244 |
comboLstpu.setLabelSeparator("");
|
247 |
comboLstpu.setLabelSeparator("");
|
245 |
comboLstpu.setDisplayField("nom");
|
248 |
comboLstpu.setDisplayField("nom");
|
246 |
comboLstpu.setEditable(false);
|
249 |
comboLstpu.setEditable(false);
|
247 |
comboLstpu.setTriggerAction(TriggerAction.ALL);
|
250 |
comboLstpu.setTriggerAction(TriggerAction.ALL);
|
248 |
comboLstpu.setStore(magazinLstpu);
|
251 |
comboLstpu.setStore(magazinLstpu);
|
249 |
comboLstpu.hide();
|
252 |
comboLstpu.hide();
|
250 |
droiteTs.add(comboLstpu);
|
253 |
droiteTs.add(comboLstpu);
|
251 |
|
254 |
|
252 |
coelModele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("stpr"));
|
255 |
coelModele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("stpr"));
|
253 |
magazinLstpr = new ListStore<Valeur>();
|
256 |
magazinLstpr = new ListStore<Valeur>();
|
254 |
magazinLstpr.add(new ArrayList<Valeur>());
|
257 |
magazinLstpr.add(new ArrayList<Valeur>());
|
255 |
comboLstpr = new ComboBox<Valeur>();
|
258 |
comboLstpr = new ComboBox<Valeur>();
|
256 |
//comboLstpr.setFieldLabel("Statut des structures privées");
|
259 |
//comboLstpr.setFieldLabel("Statut des structures privées");
|
257 |
comboLstpr.setLabelSeparator("");
|
260 |
comboLstpr.setLabelSeparator("");
|
258 |
comboLstpr.setDisplayField("nom");
|
261 |
comboLstpr.setDisplayField("nom");
|
259 |
comboLstpr.setEditable(false);
|
262 |
comboLstpr.setEditable(false);
|
260 |
comboLstpr.setTriggerAction(TriggerAction.ALL);
|
263 |
comboLstpr.setTriggerAction(TriggerAction.ALL);
|
261 |
comboLstpr.setStore(magazinLstpr);
|
264 |
comboLstpr.setStore(magazinLstpr);
|
262 |
comboLstpr.hide();
|
265 |
comboLstpr.hide();
|
263 |
droiteTs.add(comboLstpr);
|
266 |
droiteTs.add(comboLstpr);
|
264 |
|
267 |
|
265 |
ligneTs.add(gaucheTs, new ColumnData(0.5));
|
268 |
ligneTs.add(gaucheTs, new ColumnData(0.5));
|
266 |
ligneTs.add(droiteTs, new ColumnData(0.5));
|
269 |
ligneTs.add(droiteTs, new ColumnData(0.5));
|
267 |
fieldSetIdentite.add(ligneTs);
|
270 |
fieldSetIdentite.add(ligneTs);
|
268 |
|
271 |
|
269 |
DateField dateFondationChp = new DateField();
|
272 |
DateField dateFondationChp = new DateField();
|
270 |
dateFondationChp.setFieldLabel("Date de fondation");
|
273 |
dateFondationChp.setFieldLabel("Date de fondation");
|
271 |
dateFondationChp.getPropertyEditor().getFormat();
|
274 |
dateFondationChp.getPropertyEditor().getFormat();
|
272 |
dateFondationChp.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
|
275 |
dateFondationChp.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
|
273 |
dateFondationChp.getMessages().setInvalidText("La valeur saisie n'est pas une date valide. La date doit être au format «jj/mm/aaaa».");
|
276 |
dateFondationChp.getMessages().setInvalidText("La valeur saisie n'est pas une date valide. La date doit être au format «jj/mm/aaaa».");
|
274 |
fieldSetIdentite.add(dateFondationChp);
|
277 |
fieldSetIdentite.add(dateFondationChp);
|
275 |
|
278 |
|
276 |
identificationOnglet.add(fieldSetIdentite);
|
279 |
identificationOnglet.add(fieldSetIdentite);
|
277 |
|
280 |
|
278 |
// Fieldset ADRESSE
|
281 |
// Fieldset ADRESSE
|
279 |
LayoutContainer principalFdAdresse = new LayoutContainer();
|
282 |
LayoutContainer principalFdAdresse = new LayoutContainer();
|
280 |
principalFdAdresse.setLayout(new ColumnLayout());
|
283 |
principalFdAdresse.setLayout(new ColumnLayout());
|
281 |
|
284 |
|
282 |
LayoutContainer gaucheFdAdresse = new LayoutContainer();
|
285 |
LayoutContainer gaucheFdAdresse = new LayoutContainer();
|
283 |
layoutGauche = new FormLayout();
|
286 |
layoutGauche = new FormLayout();
|
284 |
layoutGauche.setLabelAlign(LabelAlign.LEFT);
|
287 |
layoutGauche.setLabelAlign(LabelAlign.LEFT);
|
285 |
layoutGauche.setLabelWidth(100);
|
288 |
layoutGauche.setLabelWidth(100);
|
286 |
layoutGauche.setPadding(0);
|
289 |
layoutGauche.setPadding(0);
|
287 |
gaucheFdAdresse.setLayout(layoutGauche);
|
290 |
gaucheFdAdresse.setLayout(layoutGauche);
|
288 |
|
291 |
|
289 |
LayoutContainer droiteFdAdresse = new LayoutContainer();
|
292 |
LayoutContainer droiteFdAdresse = new LayoutContainer();
|
290 |
layoutDroite = new FormLayout();
|
293 |
layoutDroite = new FormLayout();
|
291 |
layoutDroite.setLabelAlign(LabelAlign.LEFT);
|
294 |
layoutDroite.setLabelAlign(LabelAlign.LEFT);
|
292 |
layoutDroite.setLabelWidth(100);
|
295 |
layoutDroite.setLabelWidth(100);
|
293 |
layoutDroite.setPadding(0);
|
296 |
layoutDroite.setPadding(0);
|
294 |
droiteFdAdresse.setLayout(layoutDroite);
|
297 |
droiteFdAdresse.setLayout(layoutDroite);
|
295 |
|
298 |
|
296 |
FieldSet fieldSetAdresse = new FieldSet();
|
299 |
FieldSet fieldSetAdresse = new FieldSet();
|
297 |
fieldSetAdresse.setHeading("Adresse");
|
300 |
fieldSetAdresse.setHeading("Adresse");
|
298 |
fieldSetAdresse.setCollapsible(true);
|
301 |
fieldSetAdresse.setCollapsible(true);
|
299 |
|
302 |
|
300 |
layoutFieldset = new FormLayout();
|
303 |
layoutFieldset = new FormLayout();
|
301 |
layoutFieldset.setLabelWidth(100);
|
304 |
layoutFieldset.setLabelWidth(100);
|
302 |
layoutFieldset.setPadding(4);
|
305 |
layoutFieldset.setPadding(4);
|
303 |
fieldSetAdresse.setLayout(layoutFieldset);
|
306 |
fieldSetAdresse.setLayout(layoutFieldset);
|
304 |
|
307 |
|
305 |
TextField<String> adrChp = new TextField<String>();
|
308 |
TextField<String> adrChp = new TextField<String>();
|
306 |
adrChp.setFieldLabel("Adresse");
|
309 |
adrChp.setFieldLabel("Adresse");
|
307 |
fieldSetAdresse.add(adrChp, new FormData(550, 0));
|
310 |
fieldSetAdresse.add(adrChp, new FormData(550, 0));
|
308 |
|
311 |
|
309 |
TextField<String> cpChp = new TextField<String>();
|
312 |
TextField<String> cpChp = new TextField<String>();
|
310 |
cpChp.setFieldLabel("Code postal");
|
313 |
cpChp.setFieldLabel("Code postal");
|
311 |
gaucheFdAdresse.add(cpChp);
|
314 |
gaucheFdAdresse.add(cpChp);
|
312 |
|
315 |
|
313 |
TextField<String> villeChp = new TextField<String>();
|
316 |
TextField<String> villeChp = new TextField<String>();
|
314 |
villeChp.setFieldLabel("Ville");
|
317 |
villeChp.setFieldLabel("Ville");
|
315 |
droiteFdAdresse.add(villeChp);
|
318 |
droiteFdAdresse.add(villeChp);
|
316 |
|
319 |
|
317 |
TextField<String> regionChp = new TextField<String>();
|
320 |
TextField<String> regionChp = new TextField<String>();
|
318 |
regionChp.setFieldLabel("Région");
|
321 |
regionChp.setFieldLabel("Région");
|
319 |
gaucheFdAdresse.add(regionChp);
|
322 |
gaucheFdAdresse.add(regionChp);
|
320 |
|
323 |
|
321 |
TextField<String> paysChp = new TextField<String>();
|
324 |
TextField<String> paysChp = new TextField<String>();
|
322 |
paysChp.setFieldLabel("Pays");
|
325 |
paysChp.setFieldLabel("Pays");
|
323 |
droiteFdAdresse.add(paysChp);
|
326 |
droiteFdAdresse.add(paysChp);
|
324 |
|
327 |
|
325 |
principalFdAdresse.add(gaucheFdAdresse, new ColumnData(.5));
|
328 |
principalFdAdresse.add(gaucheFdAdresse, new ColumnData(.5));
|
326 |
principalFdAdresse.add(droiteFdAdresse, new ColumnData(.5));
|
329 |
principalFdAdresse.add(droiteFdAdresse, new ColumnData(.5));
|
327 |
fieldSetAdresse.add(principalFdAdresse);
|
330 |
fieldSetAdresse.add(principalFdAdresse);
|
328 |
identificationOnglet.add(fieldSetAdresse);
|
331 |
identificationOnglet.add(fieldSetAdresse);
|
329 |
|
332 |
|
330 |
// Fieldset TÉLÉPHONE et EMAIL
|
333 |
// Fieldset TÉLÉPHONE et EMAIL
|
331 |
|
334 |
|
332 |
LayoutContainer principalFdTelMail = new LayoutContainer();
|
335 |
LayoutContainer principalFdTelMail = new LayoutContainer();
|
333 |
principalFdTelMail.setLayout(new ColumnLayout());
|
336 |
principalFdTelMail.setLayout(new ColumnLayout());
|
334 |
|
337 |
|
335 |
LayoutContainer gaucheFdTelMail = new LayoutContainer();
|
338 |
LayoutContainer gaucheFdTelMail = new LayoutContainer();
|
336 |
gaucheFdTelMail.setLayout(creerFormLayout(100, LabelAlign.LEFT, 0));
|
339 |
gaucheFdTelMail.setLayout(creerFormLayout(100, LabelAlign.LEFT, 0));
|
337 |
|
340 |
|
338 |
LayoutContainer droiteFdTelMail = new LayoutContainer();
|
341 |
LayoutContainer droiteFdTelMail = new LayoutContainer();
|
339 |
droiteFdTelMail.setLayout(creerFormLayout(100, LabelAlign.LEFT, 0));
|
342 |
droiteFdTelMail.setLayout(creerFormLayout(100, LabelAlign.LEFT, 0));
|
340 |
|
343 |
|
341 |
FieldSet fieldSetTelMail = new FieldSet();
|
344 |
FieldSet fieldSetTelMail = new FieldSet();
|
342 |
fieldSetTelMail.setHeading("Communication");
|
345 |
fieldSetTelMail.setHeading("Communication");
|
343 |
fieldSetTelMail.setCollapsible(true);
|
346 |
fieldSetTelMail.setCollapsible(true);
|
344 |
|
347 |
|
345 |
fieldSetTelMail.setLayout(creerFormLayout(200, LabelAlign.LEFT, 4));
|
348 |
fieldSetTelMail.setLayout(creerFormLayout(200, LabelAlign.LEFT, 4));
|
346 |
|
349 |
|
347 |
TextField<String> telChp = new TextField<String>();
|
350 |
TextField<String> telChp = new TextField<String>();
|
348 |
telChp.setFieldLabel("Téléphone");
|
351 |
telChp.setFieldLabel("Téléphone");
|
349 |
gaucheFdTelMail.add(telChp);
|
352 |
gaucheFdTelMail.add(telChp);
|
350 |
|
353 |
|
351 |
TextField<String> faxChp = new TextField<String>();
|
354 |
TextField<String> faxChp = new TextField<String>();
|
352 |
faxChp.setFieldLabel("Fax");
|
355 |
faxChp.setFieldLabel("Fax");
|
353 |
droiteFdTelMail.add(faxChp);
|
356 |
droiteFdTelMail.add(faxChp);
|
354 |
|
357 |
|
355 |
TextField<String> emailChp = new TextField<String>();
|
358 |
TextField<String> emailChp = new TextField<String>();
|
356 |
emailChp.setFieldLabel("Courriel");
|
359 |
emailChp.setFieldLabel("Courriel");
|
357 |
emailChp.setToolTip("Saisir le courriel de l'organisation, pas de courriel individuel. Ex. : accueil@organisation.org");
|
360 |
emailChp.setToolTip("Saisir le courriel de l'organisation, pas de courriel individuel. Ex. : accueil@organisation.org");
|
358 |
gaucheFdTelMail.add(emailChp);
|
361 |
gaucheFdTelMail.add(emailChp);
|
359 |
|
362 |
|
360 |
TextField<String> urlChp = new TextField<String>();
|
363 |
TextField<String> urlChp = new TextField<String>();
|
361 |
urlChp.setFieldLabel("Site web");
|
364 |
urlChp.setFieldLabel("Site web");
|
362 |
droiteFdTelMail.add(urlChp);
|
365 |
droiteFdTelMail.add(urlChp);
|
363 |
|
366 |
|
364 |
principalFdTelMail.add(gaucheFdTelMail, new ColumnData(.5));
|
367 |
principalFdTelMail.add(gaucheFdTelMail, new ColumnData(.5));
|
365 |
principalFdTelMail.add(droiteFdTelMail, new ColumnData(.5));
|
368 |
principalFdTelMail.add(droiteFdTelMail, new ColumnData(.5));
|
366 |
fieldSetTelMail.add(principalFdTelMail);
|
369 |
fieldSetTelMail.add(principalFdTelMail);
|
367 |
identificationOnglet.add(fieldSetTelMail);
|
370 |
identificationOnglet.add(fieldSetTelMail);
|
368 |
|
371 |
|
369 |
onglets.add(identificationOnglet);
|
372 |
onglets.add(identificationOnglet);
|
370 |
|
373 |
|
371 |
//+-----------------------------------------------------------------------------------------------------------+
|
374 |
//+-----------------------------------------------------------------------------------------------------------+
|
372 |
// Onlget formulaire PERSONNEL
|
375 |
// Onlget formulaire PERSONNEL
|
373 |
onglets.add(creerOngletPersonnel());
|
376 |
onglets.add(creerOngletPersonnel());
|
374 |
|
377 |
|
375 |
//+-----------------------------------------------------------------------------------------------------------+
|
378 |
//+-----------------------------------------------------------------------------------------------------------+
|
376 |
// Onlget formulaire CONSERVATION
|
379 |
// Onlget formulaire CONSERVATION
|
377 |
onglets.add(creerOngletConservation());
|
380 |
onglets.add(creerOngletConservation());
|
378 |
onglets.setSelection(conservationOnglet);
|
381 |
onglets.setSelection(conservationOnglet);
|
379 |
|
382 |
|
380 |
//+-----------------------------------------------------------------------------------------------------------+
|
383 |
//+-----------------------------------------------------------------------------------------------------------+
|
381 |
// Onlget formulaire VALORISATION
|
384 |
// Onlget formulaire VALORISATION
|
382 |
TabItem valorisationOnglet = new TabItem();
|
385 |
TabItem valorisationOnglet = new TabItem();
|
383 |
valorisationOnglet.setText("Valorisation");
|
386 |
valorisationOnglet.setText("Valorisation");
|
384 |
valorisationOnglet.setLayout(new FormLayout());
|
387 |
valorisationOnglet.setLayout(new FormLayout());
|
385 |
|
388 |
|
386 |
|
389 |
|
387 |
onglets.add(valorisationOnglet);
|
390 |
onglets.add(valorisationOnglet);
|
388 |
|
391 |
|
389 |
//+-----------------------------------------------------------------------------------------------------------+
|
392 |
//+-----------------------------------------------------------------------------------------------------------+
|
390 |
// Gestion du FORMULAIRE GÉNÉRAL
|
393 |
// Gestion du FORMULAIRE GÉNÉRAL
|
391 |
|
394 |
|
392 |
// Ajout des onglets
|
395 |
// Ajout des onglets
|
393 |
panel.add(onglets);
|
396 |
panel.add(onglets);
|
394 |
|
397 |
|
395 |
// Ajout des boutons au panneau formulaire
|
398 |
// Ajout des boutons au panneau formulaire
|
396 |
Button annulerBtn = new Button("Annuler");
|
399 |
Button annulerBtn = new Button("Annuler");
|
397 |
panel.addButton(annulerBtn);
|
400 |
panel.addButton(annulerBtn);
|
398 |
Button validerBtn = new Button("Valider");
|
401 |
Button validerBtn = new Button("Valider");
|
399 |
panel.addButton(validerBtn);
|
402 |
panel.addButton(validerBtn);
|
400 |
|
403 |
|
401 |
// Ajout du panneau Formulaire à la disposition générale
|
404 |
// Ajout du panneau Formulaire à la disposition générale
|
402 |
add(panel);
|
405 |
add(panel);
|
403 |
}
|
406 |
}
|
404 |
|
407 |
|
405 |
private TabItem creerOngletConservation() {
|
408 |
private TabItem creerOngletConservation() {
|
406 |
conservationOnglet = new TabItem();
|
409 |
conservationOnglet = new TabItem();
|
407 |
conservationOnglet.setText("Conservation");
|
410 |
conservationOnglet.setText("Conservation");
|
408 |
conservationOnglet.setLayout(creerFormLayout(650, LabelAlign.TOP, null));
|
411 |
conservationOnglet.setLayout(creerFormLayout(650, LabelAlign.TOP, null));
|
409 |
|
412 |
|
410 |
CheckBoxGroup markFormationCacGrpChp = new CheckBoxGroup();
|
- |
|
411 |
CheckBox ouiMarkFormationCac = new CheckBox();
|
- |
|
412 |
ouiMarkFormationCac.setBoxLabel("Oui");
|
- |
|
413 |
CheckBox nonMarkFormationCac = new CheckBox();
|
- |
|
414 |
nonMarkFormationCac.setBoxLabel("Non");
|
413 |
RadioGroup markFormationRGrpChp = new RadioGroup("mark_formation_grp");
|
415 |
markFormationCacGrpChp.setFieldLabel("Le personnel s'occupant des collections a-t-il suivi des formations en conservations ?");
|
- |
|
416 |
markFormationCacGrpChp.add(ouiMarkFormationCac);
|
414 |
markFormationRGrpChp.setFieldLabel("Le personnel s'occupant des collections a-t-il suivi des formations en conservations ?");
|
417 |
markFormationCacGrpChp.add(nonMarkFormationCac);
|
415 |
creerChoixUniqueBr(markFormationRGrpChp, "mark_formation");
|
418 |
conservationOnglet.add(markFormationCacGrpChp);
|
416 |
conservationOnglet.add(markFormationRGrpChp);
|
419 |
|
417 |
|
420 |
TextField<String> formationChp = new TextField<String>();
|
418 |
TextField<String> formationChp = new TextField<String>();
|
421 |
formationChp.setFieldLabel("Lesquelles ?");
|
419 |
formationChp.setFieldLabel("Lesquelles ?");
|
422 |
conservationOnglet.add(formationChp);
|
420 |
conservationOnglet.add(formationChp);
|
423 |
|
421 |
|
424 |
CheckBoxGroup markInteretFormationCacGrpChp = new CheckBoxGroup();
|
- |
|
425 |
CheckBox ouiMarkInteretFormationCac = new CheckBox();
|
- |
|
426 |
ouiMarkInteretFormationCac.setBoxLabel("Oui");
|
- |
|
427 |
CheckBox nonMarkInteretFormationCac = new CheckBox();
|
- |
|
428 |
nonMarkInteretFormationCac.setBoxLabel("Non");
|
422 |
RadioGroup markInteretFormationRGrpChp = new RadioGroup("mark_interet_formation_grp");
|
429 |
markInteretFormationCacGrpChp.setFieldLabel("Seriez vous intéressé par une formation à la conservation et à la restauration d'herbier ?");
|
- |
|
430 |
markInteretFormationCacGrpChp.add(ouiMarkInteretFormationCac);
|
423 |
markInteretFormationRGrpChp.setFieldLabel("Seriez vous intéressé par une formation à la conservation et à la restauration d'herbier ?");
|
431 |
markInteretFormationCacGrpChp.add(nonMarkInteretFormationCac);
|
424 |
creerChoixUniqueBr(markInteretFormationRGrpChp, "mark_interet_formation_grp");
|
432 |
conservationOnglet.add(markInteretFormationCacGrpChp);
|
425 |
conservationOnglet.add(markInteretFormationRGrpChp);
|
433 |
|
- |
|
434 |
coelModele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("localStockage"));
|
426 |
|
435 |
trukLocalStockageCp = new ContentPanel();
|
- |
|
436 |
trukLocalStockageCp.setLayout(creerFormLayout(650, LabelAlign.TOP, 0));
|
- |
|
437 |
trukLocalStockageCp.setWidth(800);
|
- |
|
438 |
trukLocalStockageCp.setHeaderVisible(false);
|
427 |
trukLocalStockageCp = creerChoixMultipleCp("localStockage");
|
439 |
conservationOnglet.add(trukLocalStockageCp);
|
- |
|
440 |
|
428 |
conservationOnglet.add(trukLocalStockageCp);
|
441 |
coelModele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("meubleStockage"));
|
- |
|
442 |
trukMeubleStockageCp = new ContentPanel();
|
- |
|
443 |
trukMeubleStockageCp.setLayout(creerFormLayout(650, LabelAlign.TOP, 0));
|
- |
|
444 |
trukMeubleStockageCp.setWidth(800);
|
429 |
|
- |
|
430 |
trukMeubleStockageCp = creerChoixMultipleCp("meubleStockage");
|
- |
|
431 |
conservationOnglet.add(trukMeubleStockageCp);
|
- |
|
432 |
|
- |
|
433 |
trukParametreStockageCp = creerChoixMultipleCp("parametreStockage");
|
- |
|
434 |
conservationOnglet.add(trukParametreStockageCp);
|
- |
|
435 |
|
- |
|
436 |
RadioGroup markCollectionCommuneRGrpChp = new RadioGroup("mark_collection_commune_grp");
|
- |
|
437 |
markCollectionCommuneRGrpChp.setFieldLabel("Les collections botaniques sont-elles conservées avec d'autres collections dans les mêmes locaux (problème de conservation en commun) ?");
|
445 |
trukMeubleStockageCp.setHeaderVisible(false);
|
438 |
creerChoixUniqueBr(markCollectionCommuneRGrpChp, "mark_collection_commune");
|
446 |
conservationOnglet.add(trukMeubleStockageCp);
|
439 |
conservationOnglet.add(markCollectionCommuneRGrpChp);
|
447 |
|
440 |
|
448 |
return conservationOnglet;
|
441 |
return conservationOnglet;
|
449 |
}
|
442 |
}
|
450 |
|
443 |
|
451 |
|
444 |
|
452 |
private TabItem creerOngletPersonnel() {
|
445 |
private TabItem creerOngletPersonnel() {
|
453 |
personnelOnglet = new TabItem();
|
446 |
personnelOnglet = new TabItem();
|
454 |
personnelOnglet.setText("Personnel");
|
447 |
personnelOnglet.setText("Personnel");
|
455 |
FormLayout personnelOngletLayout = new FormLayout();
|
448 |
FormLayout personnelOngletLayout = new FormLayout();
|
456 |
personnelOngletLayout.setLabelWidth(400);
|
449 |
personnelOngletLayout.setLabelWidth(400);
|
457 |
personnelOnglet.setLayout(personnelOngletLayout);
|
450 |
personnelOnglet.setLayout(personnelOngletLayout);
|
458 |
|
451 |
|
459 |
NumberField nbreTotalPersonneStructureChp = new NumberField();
|
452 |
NumberField nbreTotalPersonneStructureChp = new NumberField();
|
460 |
nbreTotalPersonneStructureChp.setFieldLabel("Nombre de personne travaillant dans l'institution");
|
453 |
nbreTotalPersonneStructureChp.setFieldLabel("Nombre de personne travaillant dans l'institution");
|
461 |
nbreTotalPersonneStructureChp.setFormat(NumberFormat.getFormat("#"));
|
454 |
nbreTotalPersonneStructureChp.setFormat(NumberFormat.getFormat("#"));
|
462 |
nbreTotalPersonneStructureChp.setToolTip("Ce champ doit contenir un nombre");
|
455 |
nbreTotalPersonneStructureChp.setToolTip("Ce champ doit contenir un nombre");
|
463 |
personnelOnglet.add(nbreTotalPersonneStructureChp);
|
456 |
personnelOnglet.add(nbreTotalPersonneStructureChp);
|
464 |
|
457 |
|
465 |
personnelOnglet.add(this.creerGrillePersonnel());
|
458 |
personnelOnglet.add(this.creerGrillePersonnel());
|
466 |
|
459 |
|
467 |
nbreTotalPersonnelChp = new LabelField();
|
460 |
nbreTotalPersonnelChp = new LabelField();
|
468 |
nbreTotalPersonnelChp.setFieldLabel("Nombre de personne travaillant sur les collections");
|
461 |
nbreTotalPersonnelChp.setFieldLabel("Nombre de personne travaillant sur les collections");
|
469 |
nbreTotalPersonnelChp.setLabelSeparator(":");
|
462 |
nbreTotalPersonnelChp.setLabelSeparator(":");
|
470 |
nbreTotalPersonnelChp.setValue(""+grillePersonnel.getStore().getCount());
|
463 |
nbreTotalPersonnelChp.setValue(""+grillePersonnel.getStore().getCount());
|
471 |
personnelOnglet.add(nbreTotalPersonnelChp);
|
464 |
personnelOnglet.add(nbreTotalPersonnelChp);
|
472 |
|
465 |
|
473 |
return personnelOnglet;
|
466 |
return personnelOnglet;
|
474 |
}
|
467 |
}
|
475 |
|
468 |
|
476 |
private ContentPanel creerGrillePersonnel() {
|
469 |
private ContentPanel creerGrillePersonnel() {
|
477 |
|
470 |
|
478 |
List<Personne> personnes = new ArrayList<Personne>();
|
471 |
List<Personne> personnes = new ArrayList<Personne>();
|
479 |
personnes.add(new Personne(Valeur.FONCTION_DIRECTEUR));
|
472 |
personnes.add(new Personne(Valeur.FONCTION_DIRECTEUR));
|
480 |
personnes.add(new Personne(Valeur.FONCTION_CONSERVATEUR));
|
473 |
personnes.add(new Personne(Valeur.FONCTION_CONSERVATEUR));
|
481 |
|
474 |
|
482 |
personnelGrilleMagazin = new ListStore<Personne>();
|
475 |
personnelGrilleMagazin = new ListStore<Personne>();
|
483 |
personnelGrilleMagazin.add(personnes);
|
476 |
personnelGrilleMagazin.add(personnes);
|
484 |
|
477 |
|
485 |
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
|
478 |
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
|
486 |
|
479 |
|
487 |
CheckBoxSelectionModel<Personne> sm = new CheckBoxSelectionModel<Personne>();
|
480 |
CheckBoxSelectionModel<Personne> sm = new CheckBoxSelectionModel<Personne>();
|
488 |
configs.add(sm.getColumn());
|
481 |
configs.add(sm.getColumn());
|
489 |
|
482 |
|
490 |
ColumnConfig column = new ColumnConfig("ce_truk_fonction", "Fonction", 100);
|
483 |
ColumnConfig column = new ColumnConfig("ce_truk_fonction", "Fonction", 100);
|
491 |
coelModele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("fonction"));
|
484 |
coelModele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("fonction"));
|
492 |
magazinLiFonction = new ListStore<Valeur>();
|
485 |
magazinLiFonction = new ListStore<Valeur>();
|
493 |
magazinLiFonction.add(new ArrayList<Valeur>());
|
486 |
magazinLiFonction.add(new ArrayList<Valeur>());
|
494 |
|
487 |
|
495 |
comboLiFonction = new ComboBox<Valeur>();
|
488 |
comboLiFonction = new ComboBox<Valeur>();
|
496 |
comboLiFonction.setTriggerAction(TriggerAction.ALL);
|
489 |
comboLiFonction.setTriggerAction(TriggerAction.ALL);
|
497 |
comboLiFonction.setEditable(true);
|
490 |
comboLiFonction.setEditable(true);
|
498 |
comboLiFonction.setDisplayField("nom");
|
491 |
comboLiFonction.setDisplayField("nom");
|
499 |
//comboLiStatut.setEmptyText("Sélectionez une fonction...");
|
492 |
//comboLiStatut.setEmptyText("Sélectionez une fonction...");
|
500 |
comboLiFonction.setStore(magazinLiFonction);
|
493 |
comboLiFonction.setStore(magazinLiFonction);
|
501 |
|
494 |
|
502 |
CellEditor fonctionEditor = new CellEditor(comboLiFonction) {
|
495 |
CellEditor fonctionEditor = new CellEditor(comboLiFonction) {
|
503 |
@Override
|
496 |
@Override
|
504 |
public Object preProcessValue(Object value) {
|
497 |
public Object preProcessValue(Object value) {
|
505 |
if (value == null) {
|
498 |
if (value == null) {
|
506 |
return value;
|
499 |
return value;
|
507 |
}
|
500 |
}
|
508 |
//GWT.log("pre : "+value.toString(), null);
|
501 |
//GWT.log("pre : "+value.toString(), null);
|
509 |
return comboLiFonction.getStore().findModel("nom", (String) value);
|
502 |
return comboLiFonction.getStore().findModel("nom", (String) value);
|
510 |
}
|
503 |
}
|
511 |
|
504 |
|
512 |
@Override
|
505 |
@Override
|
513 |
public Object postProcessValue(Object value) {
|
506 |
public Object postProcessValue(Object value) {
|
514 |
if (value == null) {
|
507 |
if (value == null) {
|
515 |
return value;
|
508 |
return value;
|
516 |
}
|
509 |
}
|
517 |
//GWT.log("post : "+value.toString(), null);
|
510 |
//GWT.log("post : "+value.toString(), null);
|
518 |
return ((Valeur) value).get("nom");
|
511 |
return ((Valeur) value).get("nom");
|
519 |
}
|
512 |
}
|
520 |
};
|
513 |
};
|
521 |
column.setEditor(fonctionEditor);
|
514 |
column.setEditor(fonctionEditor);
|
522 |
configs.add(column);
|
515 |
configs.add(column);
|
523 |
|
516 |
|
524 |
column = new ColumnConfig();
|
517 |
column = new ColumnConfig();
|
525 |
column.setId("prenom");
|
518 |
column.setId("prenom");
|
526 |
column.setHeader("Prénom");
|
519 |
column.setHeader("Prénom");
|
527 |
column.setWidth(100);
|
520 |
column.setWidth(100);
|
528 |
TextField<String> prenomChp = new TextField<String>();
|
521 |
TextField<String> prenomChp = new TextField<String>();
|
529 |
prenomChp.setAllowBlank(false);
|
522 |
prenomChp.setAllowBlank(false);
|
530 |
prenomChp.getMessages().setBlankText("Ce champ est obligatoire.");
|
523 |
prenomChp.getMessages().setBlankText("Ce champ est obligatoire.");
|
531 |
prenomChp.setAutoValidate(true);
|
524 |
prenomChp.setAutoValidate(true);
|
532 |
column.setEditor(new CellEditor(prenomChp));
|
525 |
column.setEditor(new CellEditor(prenomChp));
|
533 |
configs.add(column);
|
526 |
configs.add(column);
|
534 |
|
527 |
|
535 |
column = new ColumnConfig();
|
528 |
column = new ColumnConfig();
|
536 |
column.setId("nom");
|
529 |
column.setId("nom");
|
537 |
column.setHeader("Nom");
|
530 |
column.setHeader("Nom");
|
538 |
column.setWidth(100);
|
531 |
column.setWidth(100);
|
539 |
TextField<String> nomChp = new TextField<String>();
|
532 |
TextField<String> nomChp = new TextField<String>();
|
540 |
nomChp.setAllowBlank(false);
|
533 |
nomChp.setAllowBlank(false);
|
541 |
nomChp.getMessages().setBlankText("Ce champ est obligatoire.");
|
534 |
nomChp.getMessages().setBlankText("Ce champ est obligatoire.");
|
542 |
nomChp.setAutoValidate(true);
|
535 |
nomChp.setAutoValidate(true);
|
543 |
column.setEditor(new CellEditor(nomChp));
|
536 |
column.setEditor(new CellEditor(nomChp));
|
544 |
configs.add(column);
|
537 |
configs.add(column);
|
545 |
|
538 |
|
546 |
column = new ColumnConfig("tel", "Téléphone", 100);
|
539 |
column = new ColumnConfig("tel", "Téléphone", 100);
|
547 |
TextField<String> telChp = new TextField<String>();
|
540 |
TextField<String> telChp = new TextField<String>();
|
548 |
column.setEditor(new CellEditor(telChp));
|
541 |
column.setEditor(new CellEditor(telChp));
|
549 |
configs.add(column);
|
542 |
configs.add(column);
|
550 |
|
543 |
|
551 |
column = new ColumnConfig("fax", "Fax", 100);
|
544 |
column = new ColumnConfig("fax", "Fax", 100);
|
552 |
TextField<String> faxChp = new TextField<String>();
|
545 |
TextField<String> faxChp = new TextField<String>();
|
553 |
column.setEditor(new CellEditor(faxChp));
|
546 |
column.setEditor(new CellEditor(faxChp));
|
554 |
configs.add(column);
|
547 |
configs.add(column);
|
555 |
|
548 |
|
556 |
column = new ColumnConfig("courriel", "Courriel", 100);
|
549 |
column = new ColumnConfig("courriel", "Courriel", 100);
|
557 |
TextField<String> emailChp = new TextField<String>();
|
550 |
TextField<String> emailChp = new TextField<String>();
|
558 |
column.setEditor(new CellEditor(emailChp));
|
551 |
column.setEditor(new CellEditor(emailChp));
|
559 |
configs.add(column);
|
552 |
configs.add(column);
|
560 |
|
553 |
|
561 |
coelModele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("statut"));
|
554 |
coelModele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("statut"));
|
562 |
magazinLiStatut = new ListStore<Valeur>();
|
555 |
magazinLiStatut = new ListStore<Valeur>();
|
563 |
magazinLiStatut.add(new ArrayList<Valeur>());
|
556 |
magazinLiStatut.add(new ArrayList<Valeur>());
|
564 |
|
557 |
|
565 |
comboLiStatut = new ComboBox<Valeur>();
|
558 |
comboLiStatut = new ComboBox<Valeur>();
|
566 |
comboLiStatut.setTriggerAction(TriggerAction.ALL);
|
559 |
comboLiStatut.setTriggerAction(TriggerAction.ALL);
|
567 |
comboLiStatut.setEditable(false);
|
560 |
comboLiStatut.setEditable(false);
|
568 |
comboLiStatut.setDisplayField("nom");
|
561 |
comboLiStatut.setDisplayField("nom");
|
569 |
comboLiStatut.setEmptyText("Sélectionez un statut...");
|
562 |
comboLiStatut.setEmptyText("Sélectionez un statut...");
|
570 |
comboLiStatut.setStore(magazinLiStatut);
|
563 |
comboLiStatut.setStore(magazinLiStatut);
|
571 |
|
564 |
|
572 |
CellEditor statutEditor = new CellEditor(comboLiStatut) {
|
565 |
CellEditor statutEditor = new CellEditor(comboLiStatut) {
|
573 |
@Override
|
566 |
@Override
|
574 |
public Object preProcessValue(Object value) {
|
567 |
public Object preProcessValue(Object value) {
|
575 |
if (value == null) {
|
568 |
if (value == null) {
|
576 |
return value;
|
569 |
return value;
|
577 |
}
|
570 |
}
|
578 |
//GWT.log("pre : "+value.toString(), null);
|
571 |
//GWT.log("pre : "+value.toString(), null);
|
579 |
return comboLiStatut.getStore().findModel("nom", (String) value);
|
572 |
return comboLiStatut.getStore().findModel("nom", (String) value);
|
580 |
}
|
573 |
}
|
581 |
|
574 |
|
582 |
@Override
|
575 |
@Override
|
583 |
public Object postProcessValue(Object value) {
|
576 |
public Object postProcessValue(Object value) {
|
584 |
if (value == null) {
|
577 |
if (value == null) {
|
585 |
return value;
|
578 |
return value;
|
586 |
}
|
579 |
}
|
587 |
//GWT.log("post : "+value.toString(), null);
|
580 |
//GWT.log("post : "+value.toString(), null);
|
588 |
return ((Valeur) value).get("nom");
|
581 |
return ((Valeur) value).get("nom");
|
589 |
}
|
582 |
}
|
590 |
};
|
583 |
};
|
591 |
column = new ColumnConfig("statut", "Statut", 100);
|
584 |
column = new ColumnConfig("statut", "Statut", 100);
|
592 |
column.setEditor(statutEditor);
|
585 |
column.setEditor(statutEditor);
|
593 |
configs.add(column);
|
586 |
configs.add(column);
|
594 |
|
587 |
|
595 |
column = new ColumnConfig("tps_w", "Temps travail", 100);
|
588 |
column = new ColumnConfig("tps_w", "Temps travail", 100);
|
596 |
column.setNumberFormat(NumberFormat.getFormat("##"));
|
589 |
column.setNumberFormat(NumberFormat.getFormat("##"));
|
597 |
NumberField tpsWChp = new NumberField();
|
590 |
NumberField tpsWChp = new NumberField();
|
598 |
tpsWChp.setFormat(NumberFormat.getFormat("##"));
|
591 |
tpsWChp.setFormat(NumberFormat.getFormat("##"));
|
599 |
tpsWChp.setToolTip("Ce champ doit contenir un nombre");
|
592 |
tpsWChp.setToolTip("Ce champ doit contenir un nombre");
|
600 |
column.setEditor(new CellEditor(tpsWChp));
|
593 |
column.setEditor(new CellEditor(tpsWChp));
|
601 |
configs.add(column);
|
594 |
configs.add(column);
|
602 |
|
595 |
|
603 |
column = new ColumnConfig("specialites", "Spécialités botaniques", 150);
|
596 |
column = new ColumnConfig("specialites", "Spécialités botaniques", 150);
|
604 |
TextField<String> speChp = new TextField<String>();
|
597 |
TextField<String> speChp = new TextField<String>();
|
605 |
column.setEditor(new CellEditor(speChp));
|
598 |
column.setEditor(new CellEditor(speChp));
|
606 |
configs.add(column);
|
599 |
configs.add(column);
|
607 |
|
600 |
|
608 |
CheckColumnConfig checkColumn = new CheckColumnConfig("mark_contact", "Contact ?", 60);
|
601 |
CheckColumnConfig checkColumn = new CheckColumnConfig("mark_contact", "Contact ?", 60);
|
609 |
configs.add(checkColumn);
|
602 |
configs.add(checkColumn);
|
610 |
|
603 |
|
611 |
ContentPanel cp = new ContentPanel();
|
604 |
ContentPanel cp = new ContentPanel();
|
612 |
cp.setHeading("Personnes travaillant sur les collections");
|
605 |
cp.setHeading("Personnes travaillant sur les collections");
|
613 |
cp.setIconStyle("icone-table");
|
606 |
cp.setIconStyle("icone-table");
|
614 |
cp.setLayout(new FitLayout());
|
607 |
cp.setLayout(new FitLayout());
|
615 |
cp.setFrame(true);
|
608 |
cp.setFrame(true);
|
616 |
|
609 |
|
617 |
ToolBar toolBar = new ToolBar();
|
610 |
ToolBar toolBar = new ToolBar();
|
618 |
|
611 |
|
619 |
TextToolItem ajouterPersonnelBtn = new TextToolItem("Ajouter", "icone-vcard-ajouter");
|
612 |
TextToolItem ajouterPersonnelBtn = new TextToolItem("Ajouter", "icone-vcard-ajouter");
|
620 |
ajouterPersonnelBtn.addSelectionListener(new SelectionListener<ToolBarEvent>() {
|
613 |
ajouterPersonnelBtn.addSelectionListener(new SelectionListener<ToolBarEvent>() {
|
621 |
@Override
|
614 |
@Override
|
622 |
public void componentSelected(ToolBarEvent ce) {
|
615 |
public void componentSelected(ToolBarEvent ce) {
|
623 |
Personne personne = new Personne();
|
616 |
Personne personne = new Personne();
|
624 |
grillePersonnel.stopEditing();
|
617 |
grillePersonnel.stopEditing();
|
625 |
personnelGrilleMagazin.insert(personne, 0);
|
618 |
personnelGrilleMagazin.insert(personne, 0);
|
626 |
grillePersonnel.startEditing(0, 0);
|
619 |
grillePersonnel.startEditing(0, 0);
|
627 |
// Mise à jour du nombre de personnel travaillant sur les collections
|
620 |
// Mise à jour du nombre de personnel travaillant sur les collections
|
628 |
nbreTotalPersonnelChp.setValue(""+grillePersonnel.getStore().getCount());
|
621 |
nbreTotalPersonnelChp.setValue(""+grillePersonnel.getStore().getCount());
|
629 |
// Activation du bouton supprimer si la grille contient un élément
|
622 |
// Activation du bouton supprimer si la grille contient un élément
|
630 |
if (grillePersonnel.getStore().getCount() > 0) {
|
623 |
if (grillePersonnel.getStore().getCount() > 0) {
|
631 |
ce.component.enable();
|
624 |
ce.component.enable();
|
632 |
}
|
625 |
}
|
633 |
}
|
626 |
}
|
634 |
});
|
627 |
});
|
635 |
toolBar.add(ajouterPersonnelBtn);
|
628 |
toolBar.add(ajouterPersonnelBtn);
|
636 |
toolBar.add(new SeparatorToolItem());
|
629 |
toolBar.add(new SeparatorToolItem());
|
637 |
TextToolItem supprimerPersonnelBtn = new TextToolItem("Supprimer", "icone-vcard-supprimer");
|
630 |
TextToolItem supprimerPersonnelBtn = new TextToolItem("Supprimer", "icone-vcard-supprimer");
|
638 |
supprimerPersonnelBtn.addSelectionListener(new SelectionListener<ToolBarEvent>() {
|
631 |
supprimerPersonnelBtn.addSelectionListener(new SelectionListener<ToolBarEvent>() {
|
639 |
@Override
|
632 |
@Override
|
640 |
public void componentSelected(ToolBarEvent ce) {
|
633 |
public void componentSelected(ToolBarEvent ce) {
|
641 |
grillePersonnel.getStore().remove(grillePersonnel.getStore().getAt(0));
|
634 |
grillePersonnel.getStore().remove(grillePersonnel.getStore().getAt(0));
|
642 |
// Mise à jour du nombre de personnel travaillant sur les collections
|
635 |
// Mise à jour du nombre de personnel travaillant sur les collections
|
643 |
nbreTotalPersonnelChp.setValue(""+grillePersonnel.getStore().getCount());
|
636 |
nbreTotalPersonnelChp.setValue(""+grillePersonnel.getStore().getCount());
|
644 |
// Désactivation du bouton supprimer si la grille contient plus d'élément
|
637 |
// Désactivation du bouton supprimer si la grille contient plus d'élément
|
645 |
if (grillePersonnel.getStore().getCount() == 0) {
|
638 |
if (grillePersonnel.getStore().getCount() == 0) {
|
646 |
ce.item.disable();
|
639 |
ce.item.disable();
|
647 |
}
|
640 |
}
|
648 |
}
|
641 |
}
|
649 |
});
|
642 |
});
|
650 |
toolBar.add(supprimerPersonnelBtn);
|
643 |
toolBar.add(supprimerPersonnelBtn);
|
651 |
cp.setTopComponent(toolBar);
|
644 |
cp.setTopComponent(toolBar);
|
652 |
|
645 |
|
653 |
ColumnModel cm = new ColumnModel(configs);
|
646 |
ColumnModel cm = new ColumnModel(configs);
|
654 |
|
647 |
|
655 |
grillePersonnel = new EditorGrid<Personne>(personnelGrilleMagazin, cm);
|
648 |
grillePersonnel = new EditorGrid<Personne>(personnelGrilleMagazin, cm);
|
656 |
grillePersonnel.setBorders(true);
|
649 |
grillePersonnel.setBorders(true);
|
657 |
grillePersonnel.setSelectionModel(sm);
|
650 |
grillePersonnel.setSelectionModel(sm);
|
658 |
grillePersonnel.addPlugin(sm);
|
651 |
grillePersonnel.addPlugin(sm);
|
659 |
grillePersonnel.addPlugin(checkColumn);
|
652 |
grillePersonnel.addPlugin(checkColumn);
|
660 |
grillePersonnel.setSize(1010, 400);
|
653 |
grillePersonnel.setSize(1010, 400);
|
661 |
|
654 |
|
662 |
cp.add(grillePersonnel);
|
655 |
cp.add(grillePersonnel);
|
663 |
return cp;
|
656 |
return cp;
|
664 |
}
|
657 |
}
|
665 |
|
658 |
|
666 |
/** Méthode simplifiant la création de FormLayout.
|
659 |
/** Méthode simplifiant la création de FormLayout.
|
667 |
*
|
660 |
*
|
668 |
* @param labelWidth largeur des labels
|
661 |
* @param labelWidth largeur des labels
|
669 |
* @param labelAlign alignement des labels
|
662 |
* @param labelAlign alignement des labels
|
670 |
* @param padding padding du layout
|
663 |
* @param padding padding du layout
|
671 |
* @return
|
664 |
* @return
|
672 |
*/
|
665 |
*/
|
673 |
private FormLayout creerFormLayout(Integer labelWidth, LabelAlign labelAlign, Integer padding) {
|
666 |
private FormLayout creerFormLayout(Integer labelWidth, LabelAlign labelAlign, Integer padding) {
|
674 |
FormLayout formLayout = new FormLayout();
|
667 |
FormLayout formLayout = new FormLayout();
|
675 |
formLayout.setLabelWidth(labelWidth);
|
668 |
formLayout.setLabelWidth(labelWidth);
|
676 |
formLayout.setLabelAlign(labelAlign);
|
669 |
formLayout.setLabelAlign(labelAlign);
|
677 |
if (padding != null) {
|
670 |
if (padding != null) {
|
678 |
formLayout.setPadding(padding);
|
671 |
formLayout.setPadding(padding);
|
679 |
}
|
672 |
}
|
680 |
return formLayout;
|
673 |
return formLayout;
|
681 |
}
|
674 |
}
|
- |
|
675 |
|
- |
|
676 |
/** Méthode simplifiant la création de bouton radio oui/non
|
- |
|
677 |
*
|
- |
|
678 |
* @param listeNom nom de la liste de valeur
|
- |
|
679 |
* @return
|
- |
|
680 |
*/
|
- |
|
681 |
private void creerChoixUniqueBr(RadioGroup radioGroup, String attributNom ) {
|
- |
|
682 |
Radio ouiRadio = new Radio();
|
- |
|
683 |
ouiRadio.setName(attributNom);
|
- |
|
684 |
ouiRadio.setBoxLabel("Oui");
|
- |
|
685 |
//ouiRadio.setValue(true);
|
- |
|
686 |
|
- |
|
687 |
Radio nonRadio = new Radio();
|
- |
|
688 |
nonRadio.setName(attributNom);
|
- |
|
689 |
nonRadio.setBoxLabel("Non");
|
- |
|
690 |
|
- |
|
691 |
radioGroup.add(ouiRadio);
|
- |
|
692 |
radioGroup.add(nonRadio);
|
- |
|
693 |
}
|
- |
|
694 |
|
- |
|
695 |
/** Méthode simplifiant la création de choix multiple sous forme de case à cocher.
|
- |
|
696 |
* Apelle un service retournant la liste des valeurs représentant les cases à cocher.
|
- |
|
697 |
* Ajoute ou pas un champ "Autre".
|
- |
|
698 |
*
|
- |
|
699 |
* @param listeNom nom de la liste de valeur
|
- |
|
700 |
* @return
|
- |
|
701 |
*/
|
- |
|
702 |
private ContentPanel creerChoixMultipleCp(String listeNom) {
|
- |
|
703 |
coelModele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(listeNom));
|
- |
|
704 |
ContentPanel cp = new ContentPanel();
|
- |
|
705 |
cp.setLayout(creerFormLayout(650, LabelAlign.TOP, 0));
|
- |
|
706 |
cp.setWidth("100%");
|
- |
|
707 |
cp.setHeaderVisible(false);
|
- |
|
708 |
return cp;
|
- |
|
709 |
}
|
- |
|
710 |
|
- |
|
711 |
/** Méthode simplifiant la création de choix multiple sous forme de case à cocher.
|
- |
|
712 |
* Apelle un service retournant la liste des valeurs représentant les cases à cocher.
|
- |
|
713 |
* Ajoute ou pas un champ "Autre".
|
- |
|
714 |
*
|
- |
|
715 |
* @param cp panneau conteant le groupe de case à cocher
|
- |
|
716 |
* @param cacGroup le groupe de case à cocher
|
- |
|
717 |
* @param labelTxt le texte du champ
|
- |
|
718 |
* @param listeValeurs la liste de valeurs à transformer en case à cocher
|
- |
|
719 |
* @param boolAutreChp booléen indiquant si oui ou non le champ autre doit apparaître
|
- |
|
720 |
* @return
|
- |
|
721 |
*/
|
- |
|
722 |
private void creerChoixMultipleCac(ContentPanel cp, CheckBoxGroup cacGroupe, String labelTxt, ValeurListe listeValeurs, Boolean boolAutreChp) {
|
- |
|
723 |
cacGroupe.setFieldLabel(labelTxt);
|
- |
|
724 |
for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) {
|
- |
|
725 |
String nom = listeValeurs.get(it.next()).get("nom");
|
- |
|
726 |
CheckBox cac = new CheckBox();
|
- |
|
727 |
GWT.log("Taille '"+nom+"' : "+nom.length(), null);
|
- |
|
728 |
// Calcul de la largeur de la checkbox en fonction de la taille du label
|
- |
|
729 |
int largeur = nom.length()*10;
|
- |
|
730 |
if (nom.length() > 15) {
|
- |
|
731 |
largeur = 170;
|
- |
|
732 |
}
|
- |
|
733 |
if (nom.length() > 25) {
|
- |
|
734 |
largeur = 250;
|
- |
|
735 |
}
|
- |
|
736 |
cac.setWidth(largeur);
|
- |
|
737 |
cac.setBoxLabel(nom);
|
- |
|
738 |
cacGroupe.add(cac);
|
- |
|
739 |
}
|
- |
|
740 |
cp.add(cacGroupe);
|
- |
|
741 |
|
- |
|
742 |
if (boolAutreChp == true) {
|
- |
|
743 |
ContentPanel autreCp = new ContentPanel();
|
- |
|
744 |
autreCp.setLayout(creerFormLayout(75, LabelAlign.TOP, 0));
|
- |
|
745 |
autreCp.setHeaderVisible(false);
|
- |
|
746 |
TextField<String> autreTrukLocalStockageChp = new TextField<String>();
|
- |
|
747 |
autreTrukLocalStockageChp.setFieldLabel("Autre");
|
- |
|
748 |
autreTrukLocalStockageChp.setLabelStyle("font-weight:normal;");
|
- |
|
749 |
autreTrukLocalStockageChp.setWidth(300);
|
- |
|
750 |
autreCp.add(autreTrukLocalStockageChp);
|
- |
|
751 |
cp.add(autreCp);
|
- |
|
752 |
}
|
- |
|
753 |
|
- |
|
754 |
cp.layout();
|
- |
|
755 |
}
|
682 |
|
756 |
|
683 |
public void rafraichir(Object nouvelleDonnees) {
|
757 |
public void rafraichir(Object nouvelleDonnees) {
|
684 |
if (nouvelleDonnees instanceof ValeurListe) {
|
758 |
if (nouvelleDonnees instanceof ValeurListe) {
|
685 |
ValeurListe listeValeurs = (ValeurListe) nouvelleDonnees;
|
759 |
ValeurListe listeValeurs = (ValeurListe) nouvelleDonnees;
|
686 |
|
760 |
|
687 |
List<Valeur> liste = new ArrayList<Valeur>();
|
761 |
List<Valeur> liste = new ArrayList<Valeur>();
|
688 |
for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) {
|
762 |
for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) {
|
689 |
liste.add(listeValeurs.get(it.next()));
|
763 |
liste.add(listeValeurs.get(it.next()));
|
690 |
}
|
764 |
}
|
691 |
// Test pour savoir si la liste contient des éléments
|
765 |
// Test pour savoir si la liste contient des éléments
|
692 |
if (liste.size() > 0) {
|
766 |
if (liste.size() > 0) {
|
693 |
Configuration config = (Configuration) Registry.get(RegistreId.CONFIG);
|
767 |
Configuration config = (Configuration) Registry.get(RegistreId.CONFIG);
|
694 |
if (listeValeurs.getId().equals(config.getListeId("stpr"))) {
|
768 |
if (listeValeurs.getId().equals(config.getListeId("stpr"))) {
|
695 |
magazinLstpr.removeAll();
|
769 |
magazinLstpr.removeAll();
|
696 |
magazinLstpr.add(liste);
|
770 |
magazinLstpr.add(liste);
|
697 |
comboLstpr.setStore(magazinLstpr);
|
771 |
comboLstpr.setStore(magazinLstpr);
|
698 |
}
|
772 |
}
|
699 |
if (listeValeurs.getId().equals(config.getListeId("stpu"))) {
|
773 |
if (listeValeurs.getId().equals(config.getListeId("stpu"))) {
|
700 |
magazinLstpu.removeAll();
|
774 |
magazinLstpu.removeAll();
|
701 |
magazinLstpu.add(liste);
|
775 |
magazinLstpu.add(liste);
|
702 |
comboLstpu.setStore(magazinLstpu);
|
776 |
comboLstpu.setStore(magazinLstpu);
|
703 |
}
|
777 |
}
|
704 |
if (listeValeurs.getId().equals(config.getListeId("statut"))) {
|
778 |
if (listeValeurs.getId().equals(config.getListeId("statut"))) {
|
705 |
magazinLiStatut.removeAll();
|
779 |
magazinLiStatut.removeAll();
|
706 |
magazinLiStatut.add(liste);
|
780 |
magazinLiStatut.add(liste);
|
707 |
comboLiStatut.setStore(magazinLiStatut);
|
781 |
comboLiStatut.setStore(magazinLiStatut);
|
708 |
}
|
782 |
}
|
709 |
if (listeValeurs.getId().equals(config.getListeId("fonction"))) {
|
783 |
if (listeValeurs.getId().equals(config.getListeId("fonction"))) {
|
710 |
magazinLiFonction.removeAll();
|
784 |
magazinLiFonction.removeAll();
|
711 |
magazinLiFonction.add(liste);
|
785 |
magazinLiFonction.add(liste);
|
712 |
comboLiFonction.setStore(magazinLiFonction);
|
786 |
comboLiFonction.setStore(magazinLiFonction);
|
713 |
}
|
787 |
}
|
714 |
if (listeValeurs.getId().equals(config.getListeId("localStockage"))) {
|
788 |
if (listeValeurs.getId().equals(config.getListeId("localStockage"))) {
|
715 |
trukLocalStockageCacGrpChp = new CheckBoxGroup();
|
789 |
trukLocalStockageCacGrpChp = new CheckBoxGroup();
|
716 |
trukLocalStockageCacGrpChp.setFieldLabel("Avez vous des locaux spécifiques de stockage des collections botaniques ?");
|
790 |
String labelTxt = "Avez vous des locaux spécifiques de stockage des collections botaniques ?";
|
717 |
for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) {
|
- |
|
718 |
String nom = listeValeurs.get(it.next()).get("nom");
|
- |
|
719 |
CheckBox trukLocalStockageCac = new CheckBox();
|
- |
|
720 |
// Calcul de la largeur de la checkbox en fonction de la taille du label
|
- |
|
721 |
int largeur = nom.length()*10;
|
- |
|
722 |
if (nom.length() > 20) {
|
- |
|
723 |
largeur = 170;
|
- |
|
724 |
}
|
- |
|
725 |
trukLocalStockageCac.setWidth(largeur);
|
- |
|
726 |
trukLocalStockageCac.setBoxLabel(nom);
|
- |
|
727 |
trukLocalStockageCacGrpChp.add(trukLocalStockageCac);
|
- |
|
728 |
}
|
- |
|
729 |
trukLocalStockageCp.add(trukLocalStockageCacGrpChp);
|
791 |
creerChoixMultipleCac(trukLocalStockageCp, trukLocalStockageCacGrpChp, labelTxt, listeValeurs, true);
|
730 |
|
- |
|
731 |
ContentPanel autreCp = new ContentPanel();
|
- |
|
732 |
autreCp.setLayout(creerFormLayout(75, LabelAlign.TOP, 0));
|
- |
|
733 |
autreCp.setHeaderVisible(false);
|
- |
|
734 |
TextField<String> autreTrukLocalStockageChp = new TextField<String>();
|
- |
|
735 |
autreTrukLocalStockageChp.setFieldLabel("Autre");
|
- |
|
736 |
autreTrukLocalStockageChp.setLabelStyle("font-weight:normal;");
|
- |
|
737 |
autreTrukLocalStockageChp.setWidth(300);
|
- |
|
738 |
autreCp.add(autreTrukLocalStockageChp);
|
- |
|
739 |
trukLocalStockageCp.add(autreCp);
|
- |
|
740 |
|
- |
|
741 |
trukLocalStockageCp.layout();
|
- |
|
742 |
}
|
792 |
}
|
743 |
if (listeValeurs.getId().equals(config.getListeId("meubleStockage"))) {
|
793 |
if (listeValeurs.getId().equals(config.getListeId("meubleStockage"))) {
|
744 |
trukMeubleStockageCacGrpChp = new CheckBoxGroup();
|
794 |
trukMeubleStockageCacGrpChp = new CheckBoxGroup();
|
745 |
trukMeubleStockageCacGrpChp.setFieldLabel("Avez vous des meubles spécifiques au stockage des collections botaniques ?");
|
795 |
String labelTxt = "Avez vous des meubles spécifiques au stockage des collections botaniques ?";
|
746 |
for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) {
|
- |
|
747 |
String nom = listeValeurs.get(it.next()).get("nom");
|
- |
|
748 |
CheckBox trukMeubleStockageCac = new CheckBox();
|
- |
|
749 |
GWT.log("Taille : "+nom.length(), null);
|
- |
|
750 |
// Calcul de la largeur de la checkbox en fonction de la taille du label
|
- |
|
751 |
int largeur = nom.length()*8;
|
- |
|
752 |
if (nom.length() > 20) {
|
- |
|
753 |
largeur = 170;
|
- |
|
754 |
}
|
- |
|
755 |
trukMeubleStockageCac.setWidth(largeur);
|
- |
|
756 |
trukMeubleStockageCac.setBoxLabel(nom);
|
- |
|
757 |
trukMeubleStockageCacGrpChp.add(trukMeubleStockageCac);
|
796 |
creerChoixMultipleCac(trukMeubleStockageCp, trukMeubleStockageCacGrpChp, labelTxt, listeValeurs, true);
|
758 |
}
|
797 |
}
|
759 |
trukMeubleStockageCp.add(trukMeubleStockageCacGrpChp);
|
798 |
if (listeValeurs.getId().equals(config.getListeId("parametreStockage"))) {
|
760 |
|
- |
|
761 |
ContentPanel autreCp = new ContentPanel();
|
799 |
trukParametreStockageCacGrpChp = new CheckBoxGroup();
|
762 |
autreCp.setLayout(creerFormLayout(75, LabelAlign.TOP, 0));
|
800 |
String labelTxt = "Quels paramètres maîtrisez vous ?";
|
763 |
autreCp.setHeaderVisible(false);
|
- |
|
764 |
TextField<String> autreTrukLocalStockageChp = new TextField<String>();
|
801 |
creerChoixMultipleCac(trukParametreStockageCp, trukParametreStockageCacGrpChp, labelTxt, listeValeurs, true);
|
765 |
autreTrukLocalStockageChp.setFieldLabel("Autre");
|
- |
|
766 |
autreTrukLocalStockageChp.setLabelStyle("font-weight:normal;");
|
- |
|
767 |
autreTrukLocalStockageChp.setWidth(300);
|
- |
|
768 |
autreCp.add(autreTrukLocalStockageChp);
|
- |
|
769 |
trukMeubleStockageCp.add(autreCp);
|
- |
|
770 |
|
- |
|
771 |
trukMeubleStockageCp.layout();
|
- |
|
772 |
}
|
802 |
}
|
773 |
GWT.log("La liste #"+listeValeurs.getId()+" a été reçue!", null);
|
803 |
GWT.log("La liste #"+listeValeurs.getId()+" a été reçue!", null);
|
774 |
} else {
|
804 |
} else {
|
775 |
GWT.log("La liste #"+listeValeurs.getId()+" ne contient aucune valeurs!", null);
|
805 |
GWT.log("La liste #"+listeValeurs.getId()+" ne contient aucune valeurs!", null);
|
776 |
}
|
806 |
}
|
777 |
}
|
807 |
}
|
778 |
}
|
808 |
}
|
779 |
|
809 |
|
780 |
}
|
810 |
}
|