| Line 1... |
Line 1... |
| 1 |
package org.tela_botanica.client.vues;
|
1 |
package org.tela_botanica.client.vues.collection;
|
| Line 2... |
Line 2... |
| 2 |
|
2 |
|
| Line 3... |
Line 3... |
| 3 |
import java.util.ArrayList;
|
3 |
import java.util.ArrayList;
|
| 4 |
|
4 |
|
| 5 |
import org.tela_botanica.client.Mediateur;
|
5 |
import org.tela_botanica.client.Mediateur;
|
| 6 |
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
|
6 |
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
|
| 7 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
- |
|
| 8 |
import org.tela_botanica.client.modeles.Collection;
|
- |
|
| 9 |
import org.tela_botanica.client.modeles.CollectionAPersonneListe;
|
7 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
| 10 |
import org.tela_botanica.client.modeles.CollectionAPublicationListe;
|
8 |
import org.tela_botanica.client.modeles.Collection;
|
| 11 |
import org.tela_botanica.client.modeles.Information;
|
- |
|
| 12 |
import org.tela_botanica.client.modeles.MenuApplicationId;
|
- |
|
| 13 |
import org.tela_botanica.client.modeles.Publication;
|
9 |
import org.tela_botanica.client.modeles.Information;
|
| 14 |
import org.tela_botanica.client.modeles.PublicationAPersonne;
|
10 |
import org.tela_botanica.client.modeles.MenuApplicationId;
|
| 15 |
import org.tela_botanica.client.modeles.Valeur;
|
11 |
import org.tela_botanica.client.modeles.Valeur;
|
| - |
|
12 |
import org.tela_botanica.client.util.UtilArray;
|
| - |
|
13 |
import org.tela_botanica.client.util.UtilString;
|
| Line 16... |
Line 14... |
| 16 |
import org.tela_botanica.client.util.UtilArray;
|
14 |
import org.tela_botanica.client.vues.Formulaire;
|
| 17 |
import org.tela_botanica.client.util.UtilString;
|
- |
|
| 18 |
|
15 |
import org.tela_botanica.client.vues.StructureForm;
|
| 19 |
import com.extjs.gxt.ui.client.event.BaseEvent;
|
16 |
|
| 20 |
import com.extjs.gxt.ui.client.event.ButtonEvent;
|
- |
|
| 21 |
import com.extjs.gxt.ui.client.event.Events;
|
17 |
import com.extjs.gxt.ui.client.event.BaseEvent;
|
| 22 |
import com.extjs.gxt.ui.client.event.Listener;
|
18 |
import com.extjs.gxt.ui.client.event.Events;
|
| 23 |
import com.extjs.gxt.ui.client.event.SelectionListener;
|
19 |
import com.extjs.gxt.ui.client.event.Listener;
|
| 24 |
import com.extjs.gxt.ui.client.widget.Info;
|
20 |
import com.extjs.gxt.ui.client.widget.Info;
|
| 25 |
import com.extjs.gxt.ui.client.widget.MessageBox;
|
- |
|
| 26 |
import com.extjs.gxt.ui.client.widget.TabItem;
|
21 |
import com.extjs.gxt.ui.client.widget.MessageBox;
|
| 27 |
import com.extjs.gxt.ui.client.widget.TabPanel;
|
22 |
import com.extjs.gxt.ui.client.widget.TabItem;
|
| 28 |
import com.extjs.gxt.ui.client.widget.button.Button;
|
23 |
import com.extjs.gxt.ui.client.widget.TabPanel;
|
| 29 |
import com.extjs.gxt.ui.client.widget.form.FieldSet;
|
24 |
import com.extjs.gxt.ui.client.widget.form.FieldSet;
|
| 30 |
import com.extjs.gxt.ui.client.widget.form.TextField;
|
25 |
import com.extjs.gxt.ui.client.widget.form.TextField;
|
| Line 238... |
Line 233... |
| 238 |
// Composition du titre
|
233 |
// Composition du titre
|
| 239 |
titre += " - ID : "+collection.getId();
|
234 |
titre += " - ID : "+collection.getId();
|
| 240 |
panneauFormulaire.setHeading(titre);
|
235 |
panneauFormulaire.setHeading(titre);
|
| 241 |
}
|
236 |
}
|
| Line 242... |
Line -... |
| 242 |
|
- |
|
| 243 |
@Override
|
- |
|
| 244 |
protected SelectionListener<ButtonEvent> creerEcouteurValidation() {
|
- |
|
| 245 |
SelectionListener<ButtonEvent> ecouteur = new SelectionListener<ButtonEvent>() {
|
- |
|
| 246 |
@Override
|
- |
|
| 247 |
public void componentSelected(ButtonEvent ce) {
|
- |
|
| 248 |
String code = ((Button) ce.getComponent()).getData("code");
|
- |
|
| 249 |
if (code.equals(FormulaireBarreValidation.CODE_BOUTON_VALIDER)) {
|
- |
|
| 250 |
soumettreFormulaire();
|
- |
|
| 251 |
clicBoutonvalidation = true;
|
- |
|
| 252 |
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_APPLIQUER)) {
|
- |
|
| 253 |
soumettreFormulaire();
|
- |
|
| 254 |
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_ANNULER)) {
|
- |
|
| 255 |
mediateur.clicMenu(menuIdCourant);
|
- |
|
| 256 |
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_REINITIALISER)) {
|
- |
|
| 257 |
reinitialiserFormulaire();
|
- |
|
| 258 |
}
|
- |
|
| 259 |
}
|
- |
|
| 260 |
};
|
- |
|
| 261 |
|
- |
|
| 262 |
return ecouteur;
|
- |
|
| 263 |
}
|
- |
|
| 264 |
|
237 |
|
| 265 |
protected boolean soumettreFormulaire() {
|
238 |
public boolean soumettreFormulaire() {
|
| 266 |
// Vérification de la validité des champs du formulaire
|
239 |
// Vérification de la validité des champs du formulaire
|
| 267 |
boolean fomulaireValide = verifierFormulaire();
|
240 |
boolean fomulaireValide = verifierFormulaire();
|
| 268 |
if (fomulaireValide) {
|
241 |
if (fomulaireValide) {
|
| 269 |
// Collecte des données du formulaire
|
242 |
// Collecte des données du formulaire
|
| Line 287... |
Line 260... |
| 287 |
private void soumettreOnglets() {
|
260 |
private void soumettreOnglets() {
|
| 288 |
personneOnglet.soumettre();
|
261 |
personneOnglet.soumettre();
|
| 289 |
publicationOnglet.soumettre();
|
262 |
publicationOnglet.soumettre();
|
| 290 |
}
|
263 |
}
|
| Line 291... |
Line 264... |
| 291 |
|
264 |
|
| 292 |
protected void reinitialiserFormulaire() {
|
265 |
public void reinitialiserFormulaire() {
|
| 293 |
if (mode.equals(StructureForm.MODE_MODIFIER)) {
|
266 |
if (mode.equals(StructureForm.MODE_MODIFIER)) {
|
| 294 |
mediateur.afficherFormCollection(collection.getId());
|
267 |
mediateur.afficherFormCollection(collection.getId());
|
| 295 |
} else {
|
268 |
} else {
|
| 296 |
mediateur.afficherFormCollection(null);
|
269 |
mediateur.afficherFormCollection(null);
|
| Line 319... |
Line 292... |
| 319 |
generalOnglet.collecter();
|
292 |
generalOnglet.collecter();
|
| 320 |
personneOnglet.collecter();
|
293 |
personneOnglet.collecter();
|
| 321 |
publicationOnglet.collecter();
|
294 |
publicationOnglet.collecter();
|
| 322 |
}
|
295 |
}
|
| Line 323... |
Line 296... |
| 323 |
|
296 |
|
| 324 |
protected boolean verifierFormulaire() {
|
297 |
public boolean verifierFormulaire() {
|
| Line 325... |
Line 298... |
| 325 |
ArrayList<String> messages = new ArrayList<String>();
|
298 |
ArrayList<String> messages = new ArrayList<String>();
|
| 326 |
|
299 |
|
| 327 |
// Vérification des infos sur le nom de la collection
|
300 |
// Vérification des infos sur le nom de la collection
|