Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 154 → Rev 155

/trunk/src/org/tela_botanica/client/vues/StructureListePanneauVue.java
26,6 → 26,7
import com.extjs.gxt.ui.client.widget.table.Table;
import com.extjs.gxt.ui.client.widget.table.TableColumn;
import com.extjs.gxt.ui.client.widget.table.TableColumnModel;
import com.extjs.gxt.ui.client.widget.table.TableItem;
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;
38,6 → 39,9
private Table table = null;
private ListStore<Structure> store = null;
private TableBinder<Structure> binder = null;
private TextToolItem modifier;
private TextToolItem supprimer;
private TextToolItem ajouter;
 
public StructureListePanneauVue() {
coelMediateur = Registry.get(RegistreId.MEDIATEUR);
44,7 → 48,7
structureListePanneauVue = this;
ToolBar toolBar = new ToolBar();
TextToolItem ajouter = new TextToolItem("Ajouter");
ajouter = new TextToolItem("Ajouter");
ajouter.setIconStyle(ComposantClass.ICONE_AJOUTER);
ajouter.addSelectionListener(new SelectionListener<ComponentEvent>() {
public void componentSelected(ComponentEvent ce) {
53,11 → 57,11
});
toolBar.add(ajouter);
 
TextToolItem modifier = new TextToolItem("Modifier");
modifier = new TextToolItem("Modifier");
modifier.setIconStyle(ComposantClass.ICONE_MODIFIER);
toolBar.add(modifier);
TextToolItem supprimer = new TextToolItem("Supprimer");
supprimer = new TextToolItem("Supprimer");
supprimer.setIconStyle(ComposantClass.ICONE_SUPPRIMER);
supprimer.addSelectionListener(new SelectionListener<ComponentEvent>() {
public void componentSelected(ComponentEvent ce) {
127,11 → 131,24
} else if (nouvelleDonnees instanceof Information) {
Information info = (Information) nouvelleDonnees;
if (info.getType().equals("suppression_structure")) {
GWT.log(info.toString(), null);
// Affichage d'un message d'information
//GWT.log(info.toString(), null);
Info.display("Suppression d'une Institution", info.toString().replaceAll("\n", "<br />"));
// TODO : mettre à jour le tableau en supprimant les institutions
 
// Suppression des structures sélectionnées
List<TableItem> selectionStructure = table.getSelectedItems();
final int taille = selectionStructure.size();
for (int i = 0; i < taille; i++) {
//GWT.log("INDEX :"+table.indexOf(selectionStructure.get(i)), null);
table.remove(selectionStructure.get(i));
}
// Désactivation des boutons si la liste est vide
if (table.getItemCount() == 0) {
supprimer.disable();
modifier.disable();
}
}
}
}
}