| 985 | jpm | 1 | package org.tela_botanica.client.vues.commentaire;
 | 
        
           |  |  | 2 |   | 
        
           |  |  | 3 | import org.tela_botanica.client.Mediateur;
 | 
        
           |  |  | 4 | import org.tela_botanica.client.interfaces.Rafraichissable;
 | 
        
           |  |  | 5 | import org.tela_botanica.client.modeles.Information;
 | 
        
           |  |  | 6 | import org.tela_botanica.client.modeles.commentaire.Commentaire;
 | 
        
           |  |  | 7 | import org.tela_botanica.client.modeles.commentaire.CommentaireListe;
 | 
        
           |  |  | 8 |   | 
        
           |  |  | 9 | import com.extjs.gxt.ui.client.Style.LayoutRegion;
 | 
        
           |  |  | 10 | import com.extjs.gxt.ui.client.util.Margins;
 | 
        
           |  |  | 11 | import com.extjs.gxt.ui.client.widget.LayoutContainer;
 | 
        
           |  |  | 12 | import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
 | 
        
           |  |  | 13 | import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
 | 
        
           |  |  | 14 | import com.google.gwt.core.client.GWT;
 | 
        
           |  |  | 15 |   | 
        
           |  |  | 16 | public class CommentaireVue extends LayoutContainer implements Rafraichissable {
 | 
        
           |  |  | 17 |   | 
        
           |  |  | 18 | 	private Mediateur mediateur = null;
 | 
        
           |  |  | 19 | 	private CommentaireListeVue panneauListe;
 | 
        
           |  |  | 20 | 	private CommentaireDetailVue panneauDetail;
 | 
        
           |  |  | 21 |   | 
        
           |  |  | 22 | 	public CommentaireVue(Mediateur mediateurCourant) {
 | 
        
           |  |  | 23 | 		mediateur = mediateurCourant;
 | 
        
           |  |  | 24 |   | 
        
           |  |  | 25 | 		BorderLayout layout = new BorderLayout();
 | 
        
           |  |  | 26 | 		layout.setEnableState(false);
 | 
        
           |  |  | 27 | 		setLayout(layout);
 | 
        
           |  |  | 28 |   | 
        
           |  |  | 29 | 		panneauListe = new CommentaireListeVue(mediateur);
 | 
        
           |  |  | 30 | 		add(panneauListe, new BorderLayoutData(LayoutRegion.CENTER));
 | 
        
           |  |  | 31 |   | 
        
           |  |  | 32 | 		panneauDetail = new CommentaireDetailVue(mediateur);
 | 
        
           |  |  | 33 | 		BorderLayoutData southData = new BorderLayoutData(LayoutRegion.SOUTH, .5f, 200, 1000);
 | 
        
           |  |  | 34 | 		southData.setSplit(true);
 | 
        
           |  |  | 35 | 		southData.setMargins(new Margins(5, 0, 0, 0));
 | 
        
           |  |  | 36 | 		add(panneauDetail, southData);
 | 
        
           |  |  | 37 | 	}
 | 
        
           |  |  | 38 |   | 
        
           |  |  | 39 | 	public void rafraichir(Object nouvellesDonnees) {
 | 
        
           |  |  | 40 | 		if (nouvellesDonnees instanceof Commentaire) {
 | 
        
           |  |  | 41 | 			panneauDetail.rafraichir(nouvellesDonnees);
 | 
        
           |  |  | 42 | 		} else if (nouvellesDonnees instanceof CommentaireListe) {
 | 
        
           |  |  | 43 | 			panneauListe.rafraichir(nouvellesDonnees);
 | 
        
           | 986 | jpm | 44 | 			mediateur.desactiverChargement();
 | 
        
           | 985 | jpm | 45 | 		} else if (nouvellesDonnees instanceof Information) {
 | 
        
           |  |  | 46 | 			panneauListe.rafraichir(nouvellesDonnees);
 | 
        
           |  |  | 47 | 		} else {
 | 
        
           |  |  | 48 | 			GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
 | 
        
           |  |  | 49 | 		}
 | 
        
           |  |  | 50 | 	}
 | 
        
           |  |  | 51 | }
 |