Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 1612 → Rev 1613

/trunk/src/org/tela_botanica/client/vues/collection/CollectionListeVue.java
14,6 → 14,7
import org.tela_botanica.client.modeles.Utilisateur;
import org.tela_botanica.client.modeles.collection.Collection;
import org.tela_botanica.client.modeles.collection.CollectionListe;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.modeles.publication.Publication;
import org.tela_botanica.client.modeles.structure.StructureListe;
import org.tela_botanica.client.util.Debug;
30,7 → 31,6
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.Info;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
38,7 → 38,6
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.core.client.GWT;
 
public class CollectionListeVue extends ContentPanel implements Rafraichissable {
53,6 → 52,9
private Button ajouter;
private BarrePaginationVue pagination = null;
private int indexElementSelectionne = 0;
private Collection collectionSelectionnee = null;
public CollectionListeVue(Mediateur mediateurCourant) {
mediateur = mediateurCourant;
i18nC = Mediateur.i18nC;
100,7 → 102,8
GridSelectionModel<Collection> modeleDeSelection = new GridSelectionModel<Collection>();
modeleDeSelection.addSelectionChangedListener(new SelectionChangedListener<Collection>() {
public void selectionChanged(SelectionChangedEvent<Collection> event) {
Collection collectionSelectionnee = (Collection) event.getSelectedItem();
collectionSelectionnee = (Collection) event.getSelectedItem();
indexElementSelectionne = store.indexOf(collectionSelectionnee);
clicListe(collectionSelectionnee);
}
});
177,6 → 180,18
Information info = (Information) nouvellesDonnees;
if (info.getType().equals("maj_utilisateur")) {
gererEtatActivationBouton();
} else if (info.getType().equals("modif_collection")) {
if(collectionSelectionnee != null) {
store.remove(indexElementSelectionne);
collectionSelectionnee = null;
}
Collection collecModifiee = (Collection)info.getDonnee(0);
// au cas ou le bouton appliquer aurait été cliqué avant de valider
store.remove(collecModifiee);
store.insert(collecModifiee, indexElementSelectionne);
grille.repaint();
grille.getSelectionModel().select(indexElementSelectionne, true);
clicListe(collecModifiee);
} else if (info.getType().equals("suppression_collection")) {
// Affichage d'un message d'information
InfoLogger.display(i18nC.suppressionCollection(), info.toString().replaceAll("\n", "<br />"));