Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 149 → Rev 150

/trunk/src/org/tela_botanica/client/vues/PersonneVue.java
16,7 → 16,7
public class PersonneVue extends LayoutContainer implements Rafraichissable {
 
private PanneauPersonneListe panneauPersonneListe;
private StructureDetailPanneauVue panneauInstitutionDetail;
private PersonneDetailPanneauVue panneauPersonneDetail;
 
public PersonneVue() {
BorderLayout layout = new BorderLayout();
26,12 → 26,11
panneauPersonneListe = new PanneauPersonneListe();
this.add(panneauPersonneListe, new BorderLayoutData(LayoutRegion.CENTER));
 
//TODO : ajouter le détail des personnes
/*panneauInstitutionDetail = new StructureDetailPanneauVue();
panneauPersonneDetail = new PersonneDetailPanneauVue();
BorderLayoutData southData = new BorderLayoutData(LayoutRegion.SOUTH, .5f, 200, 1000);
southData.setSplit(true);
southData.setMargins(new Margins(5, 0, 0, 0));
this.add(panneauInstitutionDetail, southData);*/
this.add(panneauPersonneDetail, southData);
}
 
public void rafraichir(Object nouvelleDonnees) {
/trunk/src/org/tela_botanica/client/vues/PanneauPersonneListe.java
86,14 → 86,14
 
binder = new TableBinder<Personne>(table, store);
binder.setAutoSelect(true);
/*
* TODO : definir evenement sur selection
* binder.addSelectionChangedListener(new SelectionChangedListener<Structure>() {
public void selectionChanged(SelectionChangedEvent<Structure> event) {
Structure m = (Structure) event.getSelectedItem();
clicListe(m);
binder.addSelectionChangedListener(new SelectionChangedListener<Personne>() {
public void selectionChanged(SelectionChangedEvent<Personne> event) {
Personne p = (Personne) event.getSelectedItem();
clicListe(p);
}
});*/
});
 
setLayout(new FitLayout());
}
106,8 → 106,8
return binder;
}
 
private void clicListe(Structure institution) {
coelMediateur.clicListeInstitution(institution);
private void clicListe(Personne personne) {
coelMediateur.clicListePersonne(personne);
}
 
public void rafraichir(Object nouvelleDonnees) {
/trunk/src/org/tela_botanica/client/vues/PersonneDetailPanneauVue.java
New file
0,0 → 1,101
package org.tela_botanica.client.vues;
 
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Personne;
import org.tela_botanica.client.modeles.Structure;
import org.tela_botanica.client.modeles.StructureListe;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.util.Format;
import com.extjs.gxt.ui.client.util.Params;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Html;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
 
public class PersonneDetailPanneauVue extends ContentPanel implements Rafraichissable {
 
private ContentPanel content;
private Html header;
private String enteteHTML = "<div class='coel-detail'><h1>{0}</h1><h2>{1}</h2></div>";
private String contenuHTML = ""; //<div style='padding: 12px;'><h2>Renseignements administratifs</h2><span style='font-weight:bold;'>Condition d'accès :</span> {9}<br /><span style='font-weight:bold;'>Adresse :</span> {1}, {2} {3}, {4}, {5}<br /><span style='font-weight:bold;'>Téléphone :</span> {6}<br /><span style='font-weight:bold;'>Fax :</span> {7}<br /><span style='font-weight:bold;'>Courriel :</span> {8}<br />{0}</div>";
private String structureNom = null;
private String structureVille = null;
private String structureDescription = null;
public PersonneDetailPanneauVue() {
Registry.register(RegistreId.PANNEAU_PERSONNE_DETAIL, this);
setHeaderVisible(false);
setLayout(new FitLayout());
 
content = new ContentPanel();
content.setBodyBorder(false);
content.setHeaderVisible(false);
content.setScrollMode(Scroll.AUTO);
 
header = new Html();
header.setStyleName("coel-detail");
content.setTopComponent(header);
 
add(content);
}
 
public void afficherDetailPersonne(Personne personne) {
if (personne != null) {
content.removeAll();
/*structureNom = structure.getNom();
structureVille = structure.getVille();
structureDescription = structure.getDescription();
Params enteteParams = new Params();
enteteParams.add(structureNom);
enteteParams.add(structureVille);
 
String eHtml = Format.substitute(enteteHTML, enteteParams);
header.getElement().setInnerHTML(eHtml);
 
Params contenuParams = new Params();
contenuParams.add(structureDescription);
contenuParams.add(structure.getAdresse());
contenuParams.add(structure.getCodePostal());
contenuParams.add(structure.getVille());
contenuParams.add(structure.getRegion());
contenuParams.add(structure.getPays());
contenuParams.add(structure.getTelephone());
contenuParams.add(structure.getFax());
contenuParams.add(structure.getCourriel());
contenuParams.add(structure.getConditionAcces());
String cHtml = Format.substitute(contenuHTML, contenuParams);
content.addText(cHtml);
*/
layout();
} else {
header.setHtml("");
content.removeAll();
}
}
 
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof Personne) {
afficherDetailPersonne((Personne) nouvellesDonnees);
}
/*if (nouvelleDonnees instanceof Structure) {
afficherDetailInstitution((Structure) nouvelleDonnees);
} else if (nouvelleDonnees instanceof StructureListe) {
StructureListe listeInstitutions = (StructureListe) nouvelleDonnees;
// Test pour savoir si la liste contient des éléments
if (listeInstitutions.size() == 0) {
afficherDetailInstitution(null);
}
}*/
}
 
}