20,6 → 20,7 |
import com.extjs.gxt.ui.client.event.SelectionListener; |
import com.extjs.gxt.ui.client.store.ListStore; |
import com.extjs.gxt.ui.client.widget.ContentPanel; |
import com.extjs.gxt.ui.client.widget.LayoutContainer; |
import com.extjs.gxt.ui.client.widget.layout.FitLayout; |
import com.extjs.gxt.ui.client.widget.table.Table; |
import com.extjs.gxt.ui.client.widget.table.TableColumn; |
26,16 → 27,17 |
import com.extjs.gxt.ui.client.widget.table.TableColumnModel; |
import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem; |
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar; |
import com.google.gwt.core.client.GWT; |
|
public class PanneauPersonneListe extends ContentPanel implements Rafraichissable { |
|
private Mediateur coelMediateur = null ; |
private Mediateur mediateur = null ; |
private Table table = null; |
private ListStore<Personne> store = null; |
private TableBinder<Personne> binder = null; |
|
public PanneauPersonneListe() { |
coelMediateur = Registry.get(RegistreId.MEDIATEUR); |
mediateur = Registry.get(RegistreId.MEDIATEUR); |
|
//Définition de la barre d'outil |
ToolBar toolBar = new ToolBar(); |
43,7 → 45,7 |
ajouter.setIconStyle(ComposantClass.ICONE_AJOUTER); |
ajouter.addSelectionListener(new SelectionListener<ComponentEvent>() { |
public void componentSelected(ComponentEvent ce) { |
coelMediateur.clicAjouterPersonne(); |
mediateur.clicAjouterPersonne(); |
} |
}); |
toolBar.add(ajouter); |
65,7 → 67,7 |
supprimer.addSelectionListener(new SelectionListener<ComponentEvent>() { |
public void componentSelected(ComponentEvent ce) { |
|
coelMediateur.clicSupprimerPersonne(r,binder.getSelection()); |
mediateur.clicSupprimerPersonne(r,binder.getSelection()); |
} |
}); |
supprimer.setIconStyle(ComposantClass.ICONE_SUPPRIMER); |
105,7 → 107,6 |
public void selectionChanged(SelectionChangedEvent<Personne> event) { |
Personne p = (Personne) event.getSelectedItem(); |
clicListe(p); |
|
} |
}); |
|
121,29 → 122,28 |
} |
|
private void clicListe(Personne personne) { |
coelMediateur.clicListePersonne(personne); |
mediateur.clicListePersonne(personne); |
} |
|
public void rafraichir(Object nouvelleDonnees) { |
if (nouvelleDonnees instanceof PersonneListe) { |
store.removeAll(); |
setHeading("Personnes"); |
|
PersonneListe listePersonnes = (PersonneListe) nouvelleDonnees; |
|
List<Personne> liste = new ArrayList<Personne>(); |
|
for (Iterator<String> it = listePersonnes.keySet().iterator(); it.hasNext();) { |
|
liste.add(listePersonnes.get(it.next())); |
} |
|
|
store.add((List<Personne>) liste); |
|
|
store.removeAll(); |
store.add(liste); |
|
// Mise à jour du panneau central |
((LayoutContainer) Registry.get(RegistreId.PANNEAU_CENTRE)).layout(); |
} else { |
GWT.log("Pas de correspondance dans la méthode rafraichir() de la classe "+this.getClass(), null); |
} |
|
layout(); |
} |
} |
|