935 |
jpm |
1 |
package org.tela_botanica.client.vues.structure;
|
60 |
jpm |
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;
|
935 |
jpm |
6 |
import org.tela_botanica.client.modeles.structure.Structure;
|
|
|
7 |
import org.tela_botanica.client.modeles.structure.StructureListe;
|
1322 |
gduche |
8 |
import org.tela_botanica.client.synchronisation.Sequenceur;
|
60 |
jpm |
9 |
|
|
|
10 |
import com.extjs.gxt.ui.client.Style.LayoutRegion;
|
|
|
11 |
import com.extjs.gxt.ui.client.util.Margins;
|
|
|
12 |
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
|
|
13 |
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
|
|
|
14 |
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
|
156 |
jp_milcent |
15 |
import com.google.gwt.core.client.GWT;
|
60 |
jpm |
16 |
|
|
|
17 |
public class StructureVue extends LayoutContainer implements Rafraichissable {
|
|
|
18 |
|
373 |
jp_milcent |
19 |
private Mediateur mediateur = null;
|
442 |
jp_milcent |
20 |
private StructureListeVue panneauInstitutionListe = null;
|
441 |
jp_milcent |
21 |
private StructureDetailVue panneauInstitutionDetail = null;
|
60 |
jpm |
22 |
|
1322 |
gduche |
23 |
private Sequenceur sequenceur = new Sequenceur();
|
|
|
24 |
|
373 |
jp_milcent |
25 |
public StructureVue(Mediateur mediateurCourant) {
|
|
|
26 |
mediateur = mediateurCourant;
|
|
|
27 |
|
60 |
jpm |
28 |
BorderLayout layout = new BorderLayout();
|
|
|
29 |
layout.setEnableState(false);
|
|
|
30 |
setLayout(layout);
|
|
|
31 |
|
442 |
jp_milcent |
32 |
panneauInstitutionListe = new StructureListeVue(mediateur);
|
373 |
jp_milcent |
33 |
add(panneauInstitutionListe, new BorderLayoutData(LayoutRegion.CENTER));
|
60 |
jpm |
34 |
|
1322 |
gduche |
35 |
panneauInstitutionDetail = new StructureDetailVue(mediateur, sequenceur);
|
373 |
jp_milcent |
36 |
BorderLayoutData dispositionSud = new BorderLayoutData(LayoutRegion.SOUTH, .5f, 200, 1000);
|
|
|
37 |
dispositionSud.setSplit(true);
|
|
|
38 |
dispositionSud.setMargins(new Margins(5, 0, 0, 0));
|
|
|
39 |
add(panneauInstitutionDetail, dispositionSud);
|
60 |
jpm |
40 |
}
|
|
|
41 |
|
851 |
gduche |
42 |
public void rafraichir(Object nouvellesDonnees) {
|
156 |
jp_milcent |
43 |
// Nous passons l'objet aux méthodes rafraichir des panneaux composant le panneau principal Structure
|
851 |
gduche |
44 |
if (nouvellesDonnees instanceof Structure) {
|
|
|
45 |
panneauInstitutionDetail.rafraichir(nouvellesDonnees);
|
|
|
46 |
} else if (nouvellesDonnees instanceof StructureListe) {
|
|
|
47 |
panneauInstitutionListe.rafraichir(nouvellesDonnees);
|
|
|
48 |
} else if (nouvellesDonnees instanceof Information) {
|
|
|
49 |
Information info = (Information) nouvellesDonnees;
|
379 |
jp_milcent |
50 |
if (info.getType().equals("liste_structure_a_personne")) {
|
851 |
gduche |
51 |
panneauInstitutionDetail.rafraichir(nouvellesDonnees);
|
379 |
jp_milcent |
52 |
}
|
373 |
jp_milcent |
53 |
} else {
|
851 |
gduche |
54 |
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
|
373 |
jp_milcent |
55 |
}
|
60 |
jpm |
56 |
}
|
|
|
57 |
|
|
|
58 |
}
|