Subversion Repositories eFlore/Applications.coel

Rev

Rev 547 | Rev 667 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
60 jpm 1
package org.tela_botanica.client.vues;
2
 
653 jp_milcent 3
import java.util.Iterator;
4
 
277 jp_milcent 5
import org.tela_botanica.client.Mediateur;
6
import org.tela_botanica.client.interfaces.Rafraichissable;
468 jp_milcent 7
import org.tela_botanica.client.modeles.CollectionListe;
277 jp_milcent 8
import org.tela_botanica.client.modeles.Information;
9
import org.tela_botanica.client.modeles.PersonneListe;
10
import org.tela_botanica.client.modeles.ProjetListe;
11
import org.tela_botanica.client.modeles.PublicationListe;
12
import org.tela_botanica.client.modeles.StructureListe;
156 jp_milcent 13
 
653 jp_milcent 14
import com.extjs.gxt.ui.client.widget.Component;
277 jp_milcent 15
import com.extjs.gxt.ui.client.widget.Info;
60 jpm 16
import com.extjs.gxt.ui.client.widget.LayoutContainer;
17
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
277 jp_milcent 18
import com.google.gwt.core.client.GWT;
60 jpm 19
 
444 jp_milcent 20
public class ContenuVue extends LayoutContainer implements Rafraichissable {
60 jpm 21
 
373 jp_milcent 22
	private Mediateur mediateur = null;
23
 
444 jp_milcent 24
	public ContenuVue(Mediateur mediateurCourant) {
373 jp_milcent 25
		mediateur = mediateurCourant;
60 jpm 26
		setLayout(new FitLayout());
364 jp_milcent 27
		setBorders(true);
60 jpm 28
	}
277 jp_milcent 29
 
653 jp_milcent 30
	public Rafraichissable getContenu() {
31
		Rafraichissable contenuPanneauCentre = null;
32
		if (getItems() != null && getItems().size() == 1) {
33
			contenuPanneauCentre = (Rafraichissable) getItem(0);
34
		}
35
		return contenuPanneauCentre;
36
	}
37
 
277 jp_milcent 38
	//+----------------------------------------------------------------------------------------------------------------+
39
	//	RAFRAICHISSEMENT
40
	//+----------------------------------------------------------------------------------------------------------------+
41
 
416 gduche 42
	public void rafraichir(Object nouvellesDonnees) {
43
		if (nouvellesDonnees instanceof StructureListe) {
44
			mediateur.afficherListeStructures((StructureListe) nouvellesDonnees);
468 jp_milcent 45
		}  else if (nouvellesDonnees instanceof CollectionListe) {
46
			mediateur.afficherListeCollections((CollectionListe) nouvellesDonnees);
416 gduche 47
		} else if (nouvellesDonnees instanceof PublicationListe) {
48
			mediateur.afficherListePublication((PublicationListe) nouvellesDonnees);
49
		} else if (nouvellesDonnees instanceof PersonneListe) {
50
			mediateur.afficherListePersonnes((PersonneListe) nouvellesDonnees);
51
		} else if (nouvellesDonnees instanceof ProjetListe)	{
52
			mediateur.afficherListeProjets((ProjetListe) nouvellesDonnees);
53
		} else if (nouvellesDonnees instanceof Information)	{
54
			Information info = (Information) nouvellesDonnees;
277 jp_milcent 55
			// Affichage des éventuels messages de déboguage ou d'alerte
56
			if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
57
				GWT.log(info.getMessages().toString(), null);
58
			}
59
			// Traitement en fonction des types d'information
60
			if (info.getType().equals("liste_personne")) {
61
				mediateur.afficherListePersonnes((PersonneListe) info.getDonnee(0));
62
				Info.display("Chargement d'une liste de personnes", "");
63
			}
64
		}
358 jp_milcent 65
		mediateur.desactiverChargement();
277 jp_milcent 66
	}
60 jpm 67
}