Line 78... |
Line 78... |
78 |
});
|
78 |
});
|
79 |
toolBar.add(supprimer);
|
79 |
toolBar.add(supprimer);
|
Line 80... |
Line 80... |
80 |
|
80 |
|
Line 81... |
Line 81... |
81 |
setTopComponent(toolBar);
|
81 |
setTopComponent(toolBar);
|
82 |
|
82 |
|
83 |
List<ColumnConfig> lstColumns = new ArrayList<ColumnConfig>();
|
83 |
List<ColumnConfig> colonnes = new ArrayList<ColumnConfig>();
|
84 |
lstColumns.add(new ColumnConfig("ville", "Ville", 150));
|
84 |
colonnes.add(new ColumnConfig("ville", "Ville", 150));
|
Line 85... |
Line 85... |
85 |
lstColumns.add(new ColumnConfig("nom", "Nom", 450));
|
85 |
colonnes.add(new ColumnConfig("nom", "Nom", 450));
|
86 |
ColumnModel cmStructure = new ColumnModel(lstColumns);
|
86 |
ColumnModel modeleDeColonne = new ColumnModel(colonnes);
|
87 |
|
87 |
|
88 |
GridSelectionModel<Structure> gsmSelectionStructure = new GridSelectionModel<Structure>();
|
88 |
GridSelectionModel<Structure> modeleDeSelection = new GridSelectionModel<Structure>();
|
89 |
gsmSelectionStructure.addSelectionChangedListener(new SelectionChangedListener<Structure>() {
|
89 |
modeleDeSelection.addSelectionChangedListener(new SelectionChangedListener<Structure>() {
|
90 |
public void selectionChanged(SelectionChangedEvent<Structure> event) {
|
90 |
public void selectionChanged(SelectionChangedEvent<Structure> event) {
|
91 |
Structure m = (Structure) event.getSelectedItem();
|
91 |
Structure structureSelectionnee = (Structure) event.getSelectedItem();
|
Line 92... |
Line 92... |
92 |
clicListe(m);
|
92 |
clicListe(structureSelectionnee);
|
93 |
}
|
93 |
}
|
Line 94... |
Line 94... |
94 |
});
|
94 |
});
|
95 |
|
95 |
|
96 |
store = new ListStore<Structure>();
|
96 |
store = new ListStore<Structure>();
|
97 |
store.sort("ville", SortDir.ASC);
|
97 |
store.sort("ville", SortDir.ASC);
|
98 |
|
98 |
|
99 |
grille = new Grid<Structure>(store, cmStructure);
|
99 |
grille = new Grid<Structure>(store, modeleDeColonne);
|
Line 100... |
Line 100... |
100 |
grille.setWidth("100%");
|
100 |
grille.setWidth("100%");
|
101 |
grille.setAutoExpandColumn("nom");
|
101 |
grille.setAutoExpandColumn("nom");
|
Line 150... |
Line 150... |
150 |
// Affichage d'un message d'information
|
150 |
// Affichage d'un message d'information
|
151 |
//GWT.log(info.toString(), null);
|
151 |
//GWT.log(info.toString(), null);
|
152 |
Info.display(i18nC.suppressionStructure(), info.toString().replaceAll("\n", "<br />"));
|
152 |
Info.display(i18nC.suppressionStructure(), info.toString().replaceAll("\n", "<br />"));
|
Line 153... |
Line 153... |
153 |
|
153 |
|
154 |
// Suppression des structures sélectionnées
|
154 |
// Suppression des structures sélectionnées
|
155 |
List<Structure> selectionStructure = grille.getSelectionModel().getSelectedItems();//table.getSelectedItems();
|
155 |
List<Structure> selectionStructure = grille.getSelectionModel().getSelectedItems();
|
156 |
final int taille = selectionStructure.size();
|
156 |
final int taille = selectionStructure.size();
|
157 |
for (int i = 0; i < taille; i++) {
|
157 |
for (int i = 0; i < taille; i++) {
|
158 |
//GWT.log("INDEX :"+table.indexOf(selectionStructure.get(i)), null);
|
158 |
//GWT.log("INDEX :"+table.indexOf(selectionStructure.get(i)), null);
|
159 |
store.remove(selectionStructure.get(i));
|
159 |
store.remove(selectionStructure.get(i));
|