Line 1... |
Line 1... |
1 |
package org.tela_botanica.client.vues;
|
1 |
package org.tela_botanica.client.vues;
|
Line 2... |
Line 2... |
2 |
|
2 |
|
3 |
import org.tela_botanica.client.RegistreId;
|
3 |
import org.tela_botanica.client.Mediateur;
|
- |
|
4 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
4 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
5 |
import org.tela_botanica.client.modeles.Publication;
|
Line 5... |
Line -... |
5 |
import org.tela_botanica.client.modeles.PublicationListe;
|
- |
|
6 |
|
6 |
import org.tela_botanica.client.modeles.PublicationListe;
|
7 |
import com.extjs.gxt.ui.client.Registry;
|
7 |
|
8 |
import com.extjs.gxt.ui.client.Style.LayoutRegion;
|
8 |
import com.extjs.gxt.ui.client.Style.LayoutRegion;
|
9 |
import com.extjs.gxt.ui.client.util.Margins;
|
- |
|
10 |
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
9 |
import com.extjs.gxt.ui.client.util.Margins;
|
11 |
import com.extjs.gxt.ui.client.widget.MessageBox;
|
10 |
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
- |
|
11 |
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
|
Line 12... |
Line 12... |
12 |
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
|
12 |
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
|
13 |
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
|
13 |
import com.google.gwt.core.client.GWT;
|
- |
|
14 |
|
14 |
|
15 |
public class PublicationVue extends LayoutContainer implements Rafraichissable {
|
15 |
public class PublicationVue extends LayoutContainer implements Rafraichissable {
|
16 |
|
Line 16... |
Line 17... |
16 |
|
17 |
private Mediateur mediateur = null;
|
- |
|
18 |
private PublicationListeVue panneauPublicationListe;
|
- |
|
19 |
private PublicationDetailVue panneauPublicationDetail;
|
17 |
private PublicationListeVue panneauPublicationListe;
|
20 |
|
18 |
private PublicationDetailVue panneauPublicationDetail;
|
21 |
public PublicationVue(Mediateur mediateurCourant) {
|
19 |
|
22 |
mediateur = mediateurCourant;
|
Line 20... |
Line 23... |
20 |
public PublicationVue() {
|
23 |
|
21 |
BorderLayout layout = new BorderLayout();
|
24 |
BorderLayout layout = new BorderLayout();
|
Line 22... |
Line 25... |
22 |
layout.setEnableState(false);
|
25 |
layout.setEnableState(false);
|
23 |
setLayout(layout);
|
26 |
setLayout(layout);
|
24 |
|
27 |
|
25 |
panneauPublicationListe = new PublicationListeVue();
|
28 |
panneauPublicationListe = new PublicationListeVue(mediateur);
|
26 |
this.add(panneauPublicationListe, new BorderLayoutData(LayoutRegion.CENTER));
|
29 |
add(panneauPublicationListe, new BorderLayoutData(LayoutRegion.CENTER));
|
27 |
|
30 |
|
Line 28... |
Line 31... |
28 |
panneauPublicationDetail = new PublicationDetailVue();
|
31 |
panneauPublicationDetail = new PublicationDetailVue(mediateur);
|
29 |
BorderLayoutData southData = new BorderLayoutData(LayoutRegion.SOUTH, .5f, 200, 1000);
|
32 |
BorderLayoutData southData = new BorderLayoutData(LayoutRegion.SOUTH, .5f, 200, 1000);
|
- |
|
33 |
southData.setSplit(true);
|
- |
|
34 |
southData.setMargins(new Margins(5, 0, 0, 0));
|
- |
|
35 |
add(panneauPublicationDetail, southData);
|
30 |
southData.setSplit(true);
|
36 |
}
|
- |
|
37 |
|
31 |
southData.setMargins(new Margins(5, 0, 0, 0));
|
38 |
public void rafraichir(Object nouvellesDonnees) {
|
32 |
this.add(panneauPublicationDetail, southData);
|
39 |
if (nouvellesDonnees instanceof Publication) {
|
33 |
}
|
40 |
panneauPublicationDetail.rafraichir(nouvellesDonnees);
|
34 |
|
41 |
} else if (nouvellesDonnees instanceof PublicationListe) {
|
35 |
public void rafraichir(Object nouvelleDonnees) {
|
- |
|
36 |
if (nouvelleDonnees instanceof PublicationListe) {
|
- |
|
37 |
remplirListe((PublicationListe) nouvelleDonnees);
|
- |
|
38 |
} else {
|
- |
|
39 |
MessageBox.alert("Attention", "Une erreur est survenue", null);
|
- |
|
40 |
}
|
- |
|
41 |
}
|
- |
|
42 |
|
- |
|
43 |
private void remplirListe(PublicationListe listePublication) {
|
- |
|
44 |
|
42 |
GWT.log(nouvellesDonnees.toString(), null);
|