Subversion Repositories eFlore/Applications.coel

Rev

Rev 1633 | Rev 1645 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1633 Rev 1637
Line 15... Line 15...
15
import org.tela_botanica.client.modeles.personne.Personne;
15
import org.tela_botanica.client.modeles.personne.Personne;
16
import org.tela_botanica.client.modeles.publication.Publication;
16
import org.tela_botanica.client.modeles.publication.Publication;
17
import org.tela_botanica.client.modeles.publication.PublicationListe;
17
import org.tela_botanica.client.modeles.publication.PublicationListe;
18
import org.tela_botanica.client.modeles.structure.Structure;
18
import org.tela_botanica.client.modeles.structure.Structure;
19
import org.tela_botanica.client.modeles.structure.StructureListe;
19
import org.tela_botanica.client.modeles.structure.StructureListe;
-
 
20
import org.tela_botanica.client.util.Debug;
20
import org.tela_botanica.client.vues.BarrePaginationVue;
21
import org.tela_botanica.client.vues.BarrePaginationVue;
Line 21... Line 22...
21
 
22
 
22
import com.extjs.gxt.ui.client.Registry;
23
import com.extjs.gxt.ui.client.Registry;
23
import com.extjs.gxt.ui.client.Style.SortDir;
24
import com.extjs.gxt.ui.client.Style.SortDir;
Line 28... Line 29...
28
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
29
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
29
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
30
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
30
import com.extjs.gxt.ui.client.event.SelectionListener;
31
import com.extjs.gxt.ui.client.event.SelectionListener;
31
import com.extjs.gxt.ui.client.store.ListStore;
32
import com.extjs.gxt.ui.client.store.ListStore;
32
import com.extjs.gxt.ui.client.widget.ContentPanel;
33
import com.extjs.gxt.ui.client.widget.ContentPanel;
33
import com.extjs.gxt.ui.client.widget.Info;
-
 
34
import com.extjs.gxt.ui.client.widget.button.Button;
34
import com.extjs.gxt.ui.client.widget.button.Button;
35
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
35
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
36
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
36
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
37
import com.extjs.gxt.ui.client.widget.grid.Grid;
37
import com.extjs.gxt.ui.client.widget.grid.Grid;
38
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
38
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
Line 105... Line 105...
105
		ColumnModel modeleDeColonne = new ColumnModel(colonnes);
105
		ColumnModel modeleDeColonne = new ColumnModel(colonnes);
Line 106... Line 106...
106
		
106
		
107
		GridSelectionModel<Structure> modeleDeSelection = new GridSelectionModel<Structure>();
107
		GridSelectionModel<Structure> modeleDeSelection = new GridSelectionModel<Structure>();
108
		modeleDeSelection.addSelectionChangedListener(new SelectionChangedListener<Structure>() {
108
		modeleDeSelection.addSelectionChangedListener(new SelectionChangedListener<Structure>() {
-
 
109
			public void selectionChanged(SelectionChangedEvent<Structure> event) {
109
			public void selectionChanged(SelectionChangedEvent<Structure> event) {
110
				if((Structure) event.getSelectedItem() != null) {
110
				structureSelectionnee = (Structure) event.getSelectedItem();
111
					structureSelectionnee = (Structure) event.getSelectedItem();
111
				indexElementSelectionne = store.indexOf(structureSelectionnee);
112
					indexElementSelectionne = store.indexOf(structureSelectionnee);
-
 
113
					clicListe(structureSelectionnee);
112
				clicListe(structureSelectionnee);
114
				}
113
			}
115
			}
Line 114... Line 116...
114
		});
116
		});
115
		
117
		
Line 200... Line 202...
200
					store.remove(selectionStructure.get(i));
202
					store.remove(selectionStructure.get(i));
201
				}
203
				}
Line 202... Line 204...
202
				
204
				
203
				gererEtatActivationBouton();
205
				gererEtatActivationBouton();
204
			} else if(info.getType().equals("structure_modifiee")) {
-
 
205
				if(structureSelectionnee != null) {
-
 
206
					store.remove(indexElementSelectionne);
-
 
207
					structureSelectionnee = null;
-
 
208
				}
206
			} else if(info.getType().equals("structure_modifiee")) {
-
 
207
				Structure structureModifiee = (Structure)info.getDonnee(0);
-
 
208
				if(structureSelectionnee != null && structureModifiee != null) {
-
 
209
					if(structureSelectionnee.getId().equals(structureModifiee.getId())) {
-
 
210
						store.remove(indexElementSelectionne);
-
 
211
					} else {
-
 
212
						structureSelectionnee = null;
209
				Structure structureModifiee = (Structure)info.getDonnee(0);
213
					}
210
				// au cas ou le bouton appliquer aurait été cliqué avant de valider
214
					// au cas ou le bouton appliquer aurait été cliqué avant de valider
211
				store.remove(structureModifiee);
215
					store.remove(structureModifiee);
212
				store.insert(structureModifiee, indexElementSelectionne);
216
					store.insert(structureModifiee, indexElementSelectionne);
-
 
217
					grille.repaint();
213
				grille.repaint();
218
					grille.getSelectionModel().deselectAll();
214
				grille.getSelectionModel().select(indexElementSelectionne, true);
219
					grille.getSelectionModel().select(indexElementSelectionne, true);
-
 
220
					clicListe(structureModifiee);
215
				clicListe(structureModifiee);
221
				}
216
			} else if (info.getType().equals("maj_utilisateur")) {
222
			} else if (info.getType().equals("maj_utilisateur")) {
217
				gererEtatActivationBouton();
223
				gererEtatActivationBouton();
218
			} else if (info.getType().equals("suppression_structure_a_personne")) {
224
			} else if (info.getType().equals("suppression_structure_a_personne")) {
219
				// Affichage d'un message d'information 
225
				// Affichage d'un message d'information