Subversion Repositories eFlore/Applications.coel

Rev

Rev 862 | Rev 875 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 862 Rev 867
Line 8... Line 8...
8
import org.tela_botanica.client.modeles.MenuApplicationId;
8
import org.tela_botanica.client.modeles.MenuApplicationId;
9
import org.tela_botanica.client.modeles.Valeur;
9
import org.tela_botanica.client.modeles.Valeur;
Line 10... Line 10...
10
 
10
 
11
import com.extjs.gxt.ui.client.event.BaseEvent;
11
import com.extjs.gxt.ui.client.event.BaseEvent;
12
import com.extjs.gxt.ui.client.event.ButtonEvent;
-
 
13
import com.extjs.gxt.ui.client.event.ComponentEvent;
12
import com.extjs.gxt.ui.client.event.ButtonEvent;
14
import com.extjs.gxt.ui.client.event.Events;
13
import com.extjs.gxt.ui.client.event.Events;
15
import com.extjs.gxt.ui.client.event.Listener;
14
import com.extjs.gxt.ui.client.event.Listener;
16
import com.extjs.gxt.ui.client.event.SelectionListener;
15
import com.extjs.gxt.ui.client.event.SelectionListener;
17
import com.extjs.gxt.ui.client.widget.Info;
16
import com.extjs.gxt.ui.client.widget.Info;
Line 24... Line 23...
24
import com.extjs.gxt.ui.client.widget.layout.FormData;
23
import com.extjs.gxt.ui.client.widget.layout.FormData;
25
import com.google.gwt.core.client.GWT;
24
import com.google.gwt.core.client.GWT;
Line 26... Line 25...
26
 
25
 
Line 27... Line 26...
27
public class CollectionForm extends Formulaire implements Rafraichissable {
26
public class CollectionForm extends Formulaire implements Rafraichissable {
28
 
27
 
Line 29... Line 28...
29
	private Collection collection = null;
28
	protected Collection collection = null;
Line 30... Line 29...
30
	private Collection collectionCollectee = null;
29
	protected Collection collectionCollectee = null;
31
 
30
 
32
	private ChampComboBoxListeValeurs typesCollectionCombo = null;
31
	private ChampComboBoxListeValeurs typesCollectionCombo = null;
33
	
32
	
34
	private TabPanel onglets = null;
33
	private TabPanel onglets = null;
35
	private TabItem generalOnglet = null;
34
	private CollectionFormGeneral generalOnglet = null;
36
	private TabItem personneOnglet = null;
35
	private CollectionFormPersonne personneOnglet = null;
37
	private TabItem publicationOnglet = null;
36
	private CollectionFormPublication publicationOnglet = null;
Line 38... Line 37...
38
	private TabItem descriptionOnglet = null;
37
	private CollectionFormDescription descriptionOnglet = null;
39
	private TabItem contenuOnglet = null;
38
	private CollectionFormContenu contenuOnglet = null;
40
	private TabItem inventaireOnglet = null;
39
	private CollectionFormInventaire inventaireOnglet = null;
Line 57... Line 56...
57
		nomChp.setAllowBlank(false);
56
		nomChp.setAllowBlank(false);
58
		nomChp.getMessages().setBlankText(i18nC.champObligatoire());
57
		nomChp.getMessages().setBlankText(i18nC.champObligatoire());
59
		principalFieldSet.add(nomChp, new FormData(450, 0));
58
		principalFieldSet.add(nomChp, new FormData(450, 0));
Line 60... Line 59...
60
		
59
		
61
		typesCollectionCombo = new ChampComboBoxListeValeurs(i18nC.typeCollectionNcd(), "typeCollectionNcd", tabIndex++);
60
		typesCollectionCombo = new ChampComboBoxListeValeurs(i18nC.typeCollectionNcd(), "typeCollectionNcd", tabIndex++);
62
		typesCollectionCombo.setValeurDefaut(Valeur.COLLECTION_NCD_HERBIER);
61
		typesCollectionCombo.peupler(Valeur.COLLECTION_NCD_HERBIER);
63
		typesCollectionCombo.addListener(Events.Select, new Listener<BaseEvent>() {
62
		typesCollectionCombo.addListener(Events.Select, new Listener<BaseEvent>() {
64
			@Override
63
			@Override
65
			public void handleEvent(BaseEvent be) {
64
			public void handleEvent(BaseEvent be) {
66
				Valeur valeur = typesCollectionCombo.getValue();
65
				Valeur valeur = typesCollectionCombo.getValue();
Line 175... Line 174...
175
		} else if (info.getType().equals("selection_collection")) {
174
		} else if (info.getType().equals("selection_collection")) {
176
			Info.display("Modification d'une collection", info.toString());
175
			Info.display("Modification d'une collection", info.toString());
177
			if (info.getDonnee(0) != null) {
176
			if (info.getDonnee(0) != null) {
178
				collection = (Collection) info.getDonnee(0);
177
				collection = (Collection) info.getDonnee(0);
179
			}
178
			}
180
			actualiserPeuplementOnglet();
179
			peupler();
181
			actualiserTitrePanneau();
180
			actualiserTitrePanneau();
182
		}
181
		}
183
	}
182
	}
184
	
183
		
185
	private void actualiserPeuplementOnglet() {
184
	private void peupler() {
-
 
185
		if (collection != null) {
-
 
186
			nomChp.setValue(collection.getNom());
186
		// TODO : déclencher le peuplement de l'onglet courant
187
			typesCollectionCombo.peupler(collection.getTypeNcd());
-
 
188
			
-
 
189
			peuplerOnglets();
-
 
190
		}
-
 
191
	}
-
 
192
 
-
 
193
	private void peuplerOnglets() {
-
 
194
		generalOnglet.peupler();
187
	}
195
	}
Line 188... Line 196...
188
 
196
 
189
	private void actualiserTitrePanneau() {
197
	private void actualiserTitrePanneau() {
190
		String titre = i18nC.titreModifFormCollection();
198
		String titre = i18nC.titreModifFormCollection();
Line 244... Line 252...
244
	}
252
	}
Line 245... Line 253...
245
	
253
	
246
	private Collection collecterCollection() {
254
	private Collection collecterCollection() {
Line -... Line 255...
-
 
255
		collectionCollectee = (Collection) collection.cloner(new Collection());
247
		collectionCollectee = (Collection) collection.cloner(new Collection());
256
		
Line 248... Line 257...
248
		
257
		this.collecter();
249
		collecterOngletGeneral();
258
		collecterOnglets();
250
		
259
		
251
		Collection collectionARetourner = null;
260
		Collection collectionARetourner = null;
252
		if (!collectionCollectee.comparer(collection)) {
261
		if (!collectionCollectee.comparer(collection)) {
253
			collectionARetourner = collection = collectionCollectee;
262
			collectionARetourner = collection = collectionCollectee;
Line 254... Line 263...
254
		}
263
		}
255
		return collectionARetourner;
264
		return collectionARetourner;
-
 
265
	}
-
 
266
	
256
	}
267
	private void collecter() {
-
 
268
		collectionCollectee.setNom(nomChp.getValue());
257
	
269
		collectionCollectee.setTypeNcd(typesCollectionCombo.getValue().getId());
258
	private void collecterOngletGeneral() {
270
	}
Line 259... Line 271...
259
		if (generalOnglet.getData("acces").equals(true)) {
271
	
260
			
272
	private void collecterOnglets() {
261
		}
273
		generalOnglet.collecter();