10,7 → 10,6 |
|
import com.extjs.gxt.ui.client.event.BaseEvent; |
import com.extjs.gxt.ui.client.event.ButtonEvent; |
import com.extjs.gxt.ui.client.event.ComponentEvent; |
import com.extjs.gxt.ui.client.event.Events; |
import com.extjs.gxt.ui.client.event.Listener; |
import com.extjs.gxt.ui.client.event.SelectionListener; |
26,18 → 25,18 |
|
public class CollectionForm extends Formulaire implements Rafraichissable { |
|
private Collection collection = null; |
private Collection collectionCollectee = null; |
protected Collection collection = null; |
protected Collection collectionCollectee = null; |
|
private ChampComboBoxListeValeurs typesCollectionCombo = null; |
|
private TabPanel onglets = null; |
private TabItem generalOnglet = null; |
private TabItem personneOnglet = null; |
private TabItem publicationOnglet = null; |
private TabItem descriptionOnglet = null; |
private TabItem contenuOnglet = null; |
private TabItem inventaireOnglet = null; |
private CollectionFormGeneral generalOnglet = null; |
private CollectionFormPersonne personneOnglet = null; |
private CollectionFormPublication publicationOnglet = null; |
private CollectionFormDescription descriptionOnglet = null; |
private CollectionFormContenu contenuOnglet = null; |
private CollectionFormInventaire inventaireOnglet = null; |
private TextField<String> nomChp = null; |
|
public CollectionForm(Mediateur mediateurCourrant, String modeDeCreation) { |
59,7 → 58,7 |
principalFieldSet.add(nomChp, new FormData(450, 0)); |
|
typesCollectionCombo = new ChampComboBoxListeValeurs(i18nC.typeCollectionNcd(), "typeCollectionNcd", tabIndex++); |
typesCollectionCombo.setValeurDefaut(Valeur.COLLECTION_NCD_HERBIER); |
typesCollectionCombo.peupler(Valeur.COLLECTION_NCD_HERBIER); |
typesCollectionCombo.addListener(Events.Select, new Listener<BaseEvent>() { |
@Override |
public void handleEvent(BaseEvent be) { |
177,15 → 176,24 |
if (info.getDonnee(0) != null) { |
collection = (Collection) info.getDonnee(0); |
} |
actualiserPeuplementOnglet(); |
peupler(); |
actualiserTitrePanneau(); |
} |
} |
|
private void actualiserPeuplementOnglet() { |
// TODO : déclencher le peuplement de l'onglet courant |
private void peupler() { |
if (collection != null) { |
nomChp.setValue(collection.getNom()); |
typesCollectionCombo.peupler(collection.getTypeNcd()); |
|
peuplerOnglets(); |
} |
} |
|
private void peuplerOnglets() { |
generalOnglet.peupler(); |
} |
|
private void actualiserTitrePanneau() { |
String titre = i18nC.titreModifFormCollection(); |
// Composition du titre |
246,7 → 254,8 |
private Collection collecterCollection() { |
collectionCollectee = (Collection) collection.cloner(new Collection()); |
|
collecterOngletGeneral(); |
this.collecter(); |
collecterOnglets(); |
|
Collection collectionARetourner = null; |
if (!collectionCollectee.comparer(collection)) { |
255,11 → 264,14 |
return collectionARetourner; |
} |
|
private void collecterOngletGeneral() { |
if (generalOnglet.getData("acces").equals(true)) { |
private void collecter() { |
collectionCollectee.setNom(nomChp.getValue()); |
collectionCollectee.setTypeNcd(typesCollectionCombo.getValue().getId()); |
} |
|
private void collecterOnglets() { |
generalOnglet.collecter(); |
} |
} |
|
protected boolean verifierFormulaire() { |
return true; |