60 |
jpm |
1 |
package org.tela_botanica.client.vues;
|
|
|
2 |
|
373 |
jp_milcent |
3 |
import org.tela_botanica.client.Mediateur;
|
60 |
jpm |
4 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
379 |
jp_milcent |
5 |
import org.tela_botanica.client.modeles.Information;
|
373 |
jp_milcent |
6 |
import org.tela_botanica.client.modeles.Structure;
|
|
|
7 |
import org.tela_botanica.client.modeles.StructureListe;
|
60 |
jpm |
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;
|
156 |
jp_milcent |
14 |
import com.google.gwt.core.client.GWT;
|
60 |
jpm |
15 |
|
|
|
16 |
public class StructureVue extends LayoutContainer implements Rafraichissable {
|
|
|
17 |
|
373 |
jp_milcent |
18 |
private Mediateur mediateur = null;
|
403 |
jp_milcent |
19 |
private StructureListePanneauVue panneauInstitutionListe = null;
|
441 |
jp_milcent |
20 |
private StructureDetailVue panneauInstitutionDetail = null;
|
60 |
jpm |
21 |
|
373 |
jp_milcent |
22 |
public StructureVue(Mediateur mediateurCourant) {
|
|
|
23 |
mediateur = mediateurCourant;
|
|
|
24 |
|
60 |
jpm |
25 |
BorderLayout layout = new BorderLayout();
|
|
|
26 |
layout.setEnableState(false);
|
|
|
27 |
setLayout(layout);
|
|
|
28 |
|
373 |
jp_milcent |
29 |
panneauInstitutionListe = new StructureListePanneauVue(mediateur);
|
|
|
30 |
add(panneauInstitutionListe, new BorderLayoutData(LayoutRegion.CENTER));
|
60 |
jpm |
31 |
|
441 |
jp_milcent |
32 |
panneauInstitutionDetail = new StructureDetailVue(mediateur);
|
373 |
jp_milcent |
33 |
BorderLayoutData dispositionSud = new BorderLayoutData(LayoutRegion.SOUTH, .5f, 200, 1000);
|
|
|
34 |
dispositionSud.setSplit(true);
|
|
|
35 |
dispositionSud.setMargins(new Margins(5, 0, 0, 0));
|
|
|
36 |
add(panneauInstitutionDetail, dispositionSud);
|
60 |
jpm |
37 |
}
|
|
|
38 |
|
|
|
39 |
public void rafraichir(Object nouvelleDonnees) {
|
156 |
jp_milcent |
40 |
// Nous passons l'objet aux méthodes rafraichir des panneaux composant le panneau principal Structure
|
373 |
jp_milcent |
41 |
if (nouvelleDonnees instanceof Structure) {
|
|
|
42 |
panneauInstitutionDetail.rafraichir(nouvelleDonnees);
|
|
|
43 |
} else if (nouvelleDonnees instanceof StructureListe) {
|
|
|
44 |
panneauInstitutionListe.rafraichir(nouvelleDonnees);
|
379 |
jp_milcent |
45 |
} else if (nouvelleDonnees instanceof Information) {
|
|
|
46 |
Information info = (Information) nouvelleDonnees;
|
|
|
47 |
if (info.getType().equals("liste_structure_a_personne")) {
|
|
|
48 |
panneauInstitutionDetail.rafraichir(nouvelleDonnees);
|
|
|
49 |
}
|
373 |
jp_milcent |
50 |
} else {
|
|
|
51 |
GWT.log("Pas de correspondance dans la méthode rafraichir() de la classe "+this.getClass(), null);
|
|
|
52 |
}
|
60 |
jpm |
53 |
}
|
|
|
54 |
|
|
|
55 |
}
|