Line 11... |
Line 11... |
11 |
import org.tela_botanica.client.modeles.Information;
|
11 |
import org.tela_botanica.client.modeles.Information;
|
12 |
import org.tela_botanica.client.modeles.Personne;
|
12 |
import org.tela_botanica.client.modeles.Personne;
|
13 |
import org.tela_botanica.client.modeles.PersonneListe;
|
13 |
import org.tela_botanica.client.modeles.PersonneListe;
|
14 |
import com.extjs.gxt.ui.client.Registry;
|
14 |
import com.extjs.gxt.ui.client.Registry;
|
15 |
import com.extjs.gxt.ui.client.Style.SortDir;
|
15 |
import com.extjs.gxt.ui.client.Style.SortDir;
|
- |
|
16 |
import com.extjs.gxt.ui.client.data.BasePagingLoader;
|
- |
|
17 |
import com.extjs.gxt.ui.client.data.ModelData;
|
- |
|
18 |
import com.extjs.gxt.ui.client.data.PagingLoadResult;
|
- |
|
19 |
import com.extjs.gxt.ui.client.data.PagingLoader;
|
- |
|
20 |
import com.extjs.gxt.ui.client.data.PagingModelMemoryProxy;
|
16 |
import com.extjs.gxt.ui.client.event.ButtonEvent;
|
21 |
import com.extjs.gxt.ui.client.event.ButtonEvent;
|
17 |
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
|
22 |
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
|
18 |
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
|
23 |
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
|
19 |
import com.extjs.gxt.ui.client.event.SelectionListener;
|
24 |
import com.extjs.gxt.ui.client.event.SelectionListener;
|
20 |
import com.extjs.gxt.ui.client.store.ListStore;
|
25 |
import com.extjs.gxt.ui.client.store.ListStore;
|
Line 24... |
Line 29... |
24 |
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
|
29 |
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
|
25 |
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
|
30 |
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
|
26 |
import com.extjs.gxt.ui.client.widget.grid.Grid;
|
31 |
import com.extjs.gxt.ui.client.widget.grid.Grid;
|
27 |
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
|
32 |
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
|
28 |
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
33 |
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
- |
|
34 |
import com.extjs.gxt.ui.client.widget.toolbar.PagingToolBar;
|
29 |
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
35 |
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
30 |
import com.google.gwt.core.client.GWT;
|
36 |
import com.google.gwt.core.client.GWT;
|
- |
|
37 |
import com.google.gwt.i18n.client.Dictionary;
|
Line 31... |
Line 38... |
31 |
|
38 |
|
Line 32... |
Line 39... |
32 |
public class PersonneListeVue extends ContentPanel implements Rafraichissable {
|
39 |
public class PersonneListeVue extends ContentPanel implements Rafraichissable {
|
Line 33... |
Line 40... |
33 |
|
40 |
|
34 |
private Mediateur mediateur = null ;
|
41 |
private Mediateur mediateur = null ;
|
- |
|
42 |
|
- |
|
43 |
private Grid<Personne> grille = null;
|
- |
|
44 |
private Personne personneSelectionnee = null;
|
Line 35... |
Line 45... |
35 |
|
45 |
private PagingToolBar pagination;
|
36 |
private Grid<Personne> grille = null;
|
46 |
private ColumnModel cm;
|
Line -... |
Line 47... |
- |
|
47 |
private final int nbElementsPage = Integer.valueOf(((Dictionary) Dictionary.getDictionary("configuration")).get("nbElementsPage"));
|
37 |
private Personne personneSelectionnee = null;
|
48 |
|
38 |
|
49 |
public PersonneListeVue() {
|
39 |
public PersonneListeVue() {
|
50 |
mediateur = Registry.get(RegistreId.MEDIATEUR);
|
40 |
mediateur = Registry.get(RegistreId.MEDIATEUR);
|
51 |
|
41 |
|
52 |
|
Line 116... |
Line 127... |
116 |
ccPrenom.setHeader("Prénom");
|
127 |
ccPrenom.setHeader("Prénom");
|
117 |
ccPrenom.setWidth(100);
|
128 |
ccPrenom.setWidth(100);
|
118 |
ccPrenom.setHidden(true);
|
129 |
ccPrenom.setHidden(true);
|
119 |
lstColumns.add(ccPrenom);
|
130 |
lstColumns.add(ccPrenom);
|
Line -... |
Line 131... |
- |
|
131 |
|
120 |
|
132 |
cm = new ColumnModel(lstColumns);
|
121 |
grille = new Grid<Personne>( new ListStore<Personne>(),new ColumnModel(lstColumns));
|
133 |
grille = new Grid<Personne>( new ListStore<Personne>(), cm);
|
122 |
GridSelectionModel<Personne> gsmSelectionGrille = new GridSelectionModel<Personne>();
|
134 |
GridSelectionModel<Personne> gsmSelectionGrille = new GridSelectionModel<Personne>();
|
123 |
gsmSelectionGrille.addSelectionChangedListener(new SelectionChangedListener<Personne>() {
|
135 |
gsmSelectionGrille.addSelectionChangedListener(new SelectionChangedListener<Personne>() {
|
124 |
public void selectionChanged(SelectionChangedEvent<Personne> event) {
|
136 |
public void selectionChanged(SelectionChangedEvent<Personne> event) {
|
125 |
Personne p = (Personne) event.getSelectedItem();
|
137 |
Personne p = (Personne) event.getSelectedItem();
|
Line 128... |
Line 140... |
128 |
}
|
140 |
}
|
129 |
});
|
141 |
});
|
Line 130... |
Line 142... |
130 |
|
142 |
|
131 |
grille.setSelectionModel(gsmSelectionGrille);
|
143 |
grille.setSelectionModel(gsmSelectionGrille);
|
- |
|
144 |
grille.setAutoExpandColumn("fmt_nom_complet");
|
Line -... |
Line 145... |
- |
|
145 |
add(grille);
|
- |
|
146 |
|
Line 132... |
Line -... |
132 |
grille.setAutoExpandColumn("fmt_nom_complet");
|
- |
|
133 |
|
147 |
pagination = new PagingToolBar(nbElementsPage);
|
134 |
|
148 |
setBottomComponent(pagination);
|
Line 135... |
Line 149... |
135 |
add(grille);
|
149 |
|
136 |
setLayout(new FitLayout());
|
150 |
setLayout(new FitLayout());
|
Line 150... |
Line 164... |
150 |
List<Personne> liste = new ArrayList<Personne>();
|
164 |
List<Personne> liste = new ArrayList<Personne>();
|
151 |
for (Iterator<String> it = listePersonnes.keySet().iterator(); it.hasNext();) {
|
165 |
for (Iterator<String> it = listePersonnes.keySet().iterator(); it.hasNext();) {
|
152 |
liste.add(listePersonnes.get(it.next()));
|
166 |
liste.add(listePersonnes.get(it.next()));
|
153 |
}
|
167 |
}
|
Line 154... |
Line 168... |
154 |
|
168 |
|
- |
|
169 |
PagingModelMemoryProxy proxy = new PagingModelMemoryProxy(liste);
|
155 |
ListStore<Personne> store = grille.getStore();
|
170 |
PagingLoader<PagingLoadResult<ModelData>> loader = new BasePagingLoader<PagingLoadResult<ModelData>>(proxy);
|
156 |
store.removeAll();
|
171 |
loader.setRemoteSort(true);
|
- |
|
172 |
pagination.bind(loader);
|
- |
|
173 |
loader.load(0, nbElementsPage);
|
- |
|
174 |
|
- |
|
175 |
ListStore<Personne> store = new ListStore<Personne>(loader);
|
Line 157... |
Line 176... |
157 |
store.add(liste);
|
176 |
grille.reconfigure(store, cm);
|
Line 158... |
Line 177... |
158 |
|
177 |
|
159 |
mediateur.actualiserPanneauCentral();
|
178 |
mediateur.actualiserPanneauCentral();
|