106 |
aurelien |
1 |
package org.tela_botanica.client.vues;
|
|
|
2 |
|
|
|
3 |
import org.tela_botanica.client.RegistreId;
|
|
|
4 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
|
|
5 |
import org.tela_botanica.client.modeles.PublicationListe;
|
|
|
6 |
import org.tela_botanica.client.modeles.StructureListe;
|
|
|
7 |
|
|
|
8 |
import com.extjs.gxt.ui.client.Registry;
|
|
|
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.user.client.Window;
|
|
|
15 |
|
|
|
16 |
public class PublicationVue extends LayoutContainer implements Rafraichissable {
|
|
|
17 |
|
|
|
18 |
private PublicationListePanneauVue panneauPublicationListe;
|
|
|
19 |
private PublicationDetailPanneauVue panneauPublicationDetail;
|
|
|
20 |
|
|
|
21 |
public PublicationVue() {
|
|
|
22 |
BorderLayout layout = new BorderLayout();
|
|
|
23 |
layout.setEnableState(false);
|
|
|
24 |
setLayout(layout);
|
|
|
25 |
|
|
|
26 |
panneauPublicationListe = new PublicationListePanneauVue();
|
|
|
27 |
this.add(panneauPublicationListe, new BorderLayoutData(LayoutRegion.CENTER));
|
|
|
28 |
|
|
|
29 |
panneauPublicationDetail = new PublicationDetailPanneauVue();
|
|
|
30 |
BorderLayoutData southData = new BorderLayoutData(LayoutRegion.SOUTH, .5f, 200, 1000);
|
|
|
31 |
southData.setSplit(true);
|
|
|
32 |
southData.setMargins(new Margins(5, 0, 0, 0));
|
|
|
33 |
this.add(panneauPublicationDetail, southData);
|
|
|
34 |
}
|
|
|
35 |
|
|
|
36 |
public void rafraichir(Object nouvelleDonnees) {
|
|
|
37 |
if (nouvelleDonnees instanceof PublicationListe) {
|
|
|
38 |
remplirListe((PublicationListe) nouvelleDonnees);
|
|
|
39 |
} else {
|
|
|
40 |
Window.alert("Problème!");
|
|
|
41 |
}
|
|
|
42 |
}
|
|
|
43 |
|
|
|
44 |
private void remplirListe(PublicationListe listePublication) {
|
|
|
45 |
|
|
|
46 |
LayoutContainer panneauCentre = (LayoutContainer) Registry.get(RegistreId.PANNEAU_CENTRE);
|
|
|
47 |
panneauPublicationListe.rafraichir(listePublication);
|
|
|
48 |
panneauPublicationDetail.rafraichir(listePublication);
|
|
|
49 |
panneauCentre.layout();
|
|
|
50 |
}
|
|
|
51 |
|
|
|
52 |
}
|