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;
|
442 |
jp_milcent |
19 |
private StructureListeVue 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 |
|
442 |
jp_milcent |
29 |
panneauInstitutionListe = new StructureListeVue(mediateur);
|
373 |
jp_milcent |
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 |
|
851 |
gduche |
39 |
public void rafraichir(Object nouvellesDonnees) {
|
156 |
jp_milcent |
40 |
// Nous passons l'objet aux méthodes rafraichir des panneaux composant le panneau principal Structure
|
851 |
gduche |
41 |
if (nouvellesDonnees instanceof Structure) {
|
|
|
42 |
panneauInstitutionDetail.rafraichir(nouvellesDonnees);
|
|
|
43 |
} else if (nouvellesDonnees instanceof StructureListe) {
|
|
|
44 |
panneauInstitutionListe.rafraichir(nouvellesDonnees);
|
553 |
jp_milcent |
45 |
mediateur.desactiverChargement();
|
851 |
gduche |
46 |
} else if (nouvellesDonnees instanceof Information) {
|
|
|
47 |
Information info = (Information) nouvellesDonnees;
|
379 |
jp_milcent |
48 |
if (info.getType().equals("liste_structure_a_personne")) {
|
851 |
gduche |
49 |
panneauInstitutionDetail.rafraichir(nouvellesDonnees);
|
379 |
jp_milcent |
50 |
}
|
373 |
jp_milcent |
51 |
} else {
|
851 |
gduche |
52 |
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
|
373 |
jp_milcent |
53 |
}
|
60 |
jpm |
54 |
}
|
|
|
55 |
|
|
|
56 |
}
|