Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 1633 → Rev 1637

/trunk/src/org/tela_botanica/client/vues/structure/StructureListeVue.java
17,6 → 17,7
import org.tela_botanica.client.modeles.publication.PublicationListe;
import org.tela_botanica.client.modeles.structure.Structure;
import org.tela_botanica.client.modeles.structure.StructureListe;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.vues.BarrePaginationVue;
 
import com.extjs.gxt.ui.client.Registry;
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;
107,9 → 107,11
GridSelectionModel<Structure> modeleDeSelection = new GridSelectionModel<Structure>();
modeleDeSelection.addSelectionChangedListener(new SelectionChangedListener<Structure>() {
public void selectionChanged(SelectionChangedEvent<Structure> event) {
structureSelectionnee = (Structure) event.getSelectedItem();
indexElementSelectionne = store.indexOf(structureSelectionnee);
clicListe(structureSelectionnee);
if((Structure) event.getSelectedItem() != null) {
structureSelectionnee = (Structure) event.getSelectedItem();
indexElementSelectionne = store.indexOf(structureSelectionnee);
clicListe(structureSelectionnee);
}
}
});
202,17 → 204,21
gererEtatActivationBouton();
} else if(info.getType().equals("structure_modifiee")) {
if(structureSelectionnee != null) {
store.remove(indexElementSelectionne);
structureSelectionnee = null;
Structure structureModifiee = (Structure)info.getDonnee(0);
if(structureSelectionnee != null && structureModifiee != null) {
if(structureSelectionnee.getId().equals(structureModifiee.getId())) {
store.remove(indexElementSelectionne);
} else {
structureSelectionnee = null;
}
// au cas ou le bouton appliquer aurait été cliqué avant de valider
store.remove(structureModifiee);
store.insert(structureModifiee, indexElementSelectionne);
grille.repaint();
grille.getSelectionModel().deselectAll();
grille.getSelectionModel().select(indexElementSelectionne, true);
clicListe(structureModifiee);
}
Structure structureModifiee = (Structure)info.getDonnee(0);
// au cas ou le bouton appliquer aurait été cliqué avant de valider
store.remove(structureModifiee);
store.insert(structureModifiee, indexElementSelectionne);
grille.repaint();
grille.getSelectionModel().select(indexElementSelectionne, true);
clicListe(structureModifiee);
} else if (info.getType().equals("maj_utilisateur")) {
gererEtatActivationBouton();
} else if (info.getType().equals("suppression_structure_a_personne")) {