Line 28... |
Line 28... |
28 |
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
|
28 |
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
|
29 |
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
|
29 |
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
|
30 |
import com.extjs.gxt.ui.client.event.SelectionListener;
|
30 |
import com.extjs.gxt.ui.client.event.SelectionListener;
|
31 |
import com.extjs.gxt.ui.client.store.ListStore;
|
31 |
import com.extjs.gxt.ui.client.store.ListStore;
|
32 |
import com.extjs.gxt.ui.client.widget.ContentPanel;
|
32 |
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;
|
33 |
import com.extjs.gxt.ui.client.widget.button.Button;
|
35 |
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
|
34 |
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
|
36 |
import com.extjs.gxt.ui.client.widget.grid.ColumnData;
|
35 |
import com.extjs.gxt.ui.client.widget.grid.ColumnData;
|
37 |
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
|
36 |
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
|
38 |
import com.extjs.gxt.ui.client.widget.grid.Grid;
|
37 |
import com.extjs.gxt.ui.client.widget.grid.Grid;
|
39 |
import com.extjs.gxt.ui.client.widget.grid.GridCellRenderer;
|
38 |
import com.extjs.gxt.ui.client.widget.grid.GridCellRenderer;
|
40 |
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
|
39 |
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
|
41 |
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
40 |
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
42 |
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
41 |
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
43 |
import com.google.gwt.core.client.GWT;
|
42 |
import com.google.gwt.core.client.GWT;
|
44 |
import com.google.gwt.user.client.Window;
|
- |
|
Line 45... |
Line 43... |
45 |
|
43 |
|
Line 46... |
Line 44... |
46 |
public class PublicationListeVue extends ContentPanel implements Rafraichissable {
|
44 |
public class PublicationListeVue extends ContentPanel implements Rafraichissable {
|
47 |
|
45 |
|
Line 56... |
Line 54... |
56 |
private Button modifier;
|
54 |
private Button modifier;
|
57 |
private Button supprimer;
|
55 |
private Button supprimer;
|
Line 58... |
Line 56... |
58 |
|
56 |
|
Line -... |
Line 57... |
- |
|
57 |
private BarrePaginationVue pagination = null;
|
- |
|
58 |
|
- |
|
59 |
private int indexElementSelectionne = 0;
|
59 |
private BarrePaginationVue pagination = null;
|
60 |
private Publication publicationSelectionnee = null;
|
60 |
|
61 |
|
61 |
public PublicationListeVue(Mediateur mediateurCourant) {
|
62 |
public PublicationListeVue(Mediateur mediateurCourant) {
|
Line 62... |
Line 63... |
62 |
mediateur = mediateurCourant;
|
63 |
mediateur = mediateurCourant;
|
Line 109... |
Line 110... |
109 |
modeleDesColonnes = new ColumnModel(colonnes);
|
110 |
modeleDesColonnes = new ColumnModel(colonnes);
|
Line 110... |
Line 111... |
110 |
|
111 |
|
111 |
GridSelectionModel<Publication> modeleDeSelection = new GridSelectionModel<Publication>();
|
112 |
GridSelectionModel<Publication> modeleDeSelection = new GridSelectionModel<Publication>();
|
112 |
modeleDeSelection.addSelectionChangedListener(new SelectionChangedListener<Publication>() {
|
113 |
modeleDeSelection.addSelectionChangedListener(new SelectionChangedListener<Publication>() {
|
113 |
public void selectionChanged(SelectionChangedEvent<Publication> event) {
|
114 |
public void selectionChanged(SelectionChangedEvent<Publication> event) {
|
- |
|
115 |
publicationSelectionnee = (Publication) event.getSelectedItem();
|
114 |
Publication publication = (Publication) event.getSelectedItem();
|
116 |
indexElementSelectionne = store.indexOf(publicationSelectionnee);
|
115 |
clicListe(publication);
|
117 |
clicListe(publicationSelectionnee);
|
116 |
}
|
118 |
}
|
Line 117... |
Line 119... |
117 |
});
|
119 |
});
|
118 |
|
120 |
|
Line 204... |
Line 206... |
204 |
}
|
206 |
}
|
205 |
} else if (nouvellesDonnees instanceof Information) {
|
207 |
} else if (nouvellesDonnees instanceof Information) {
|
206 |
Information info = (Information) nouvellesDonnees;
|
208 |
Information info = (Information) nouvellesDonnees;
|
207 |
if (info.getType().equals("maj_utilisateur")) {
|
209 |
if (info.getType().equals("maj_utilisateur")) {
|
208 |
gererEtatActivationBouton();
|
210 |
gererEtatActivationBouton();
|
- |
|
211 |
} else if (info.getType().equals("publication_modifiee")) {
|
- |
|
212 |
if(publicationSelectionnee != null) {
|
- |
|
213 |
|
- |
|
214 |
store.remove(indexElementSelectionne);
|
- |
|
215 |
publicationSelectionnee = null;
|
- |
|
216 |
}
|
- |
|
217 |
Publication publiModifee = (Publication)info.getDonnee(0);
|
- |
|
218 |
// au cas ou le bouton appliquer aurait été cliqué avant de valider
|
- |
|
219 |
store.remove(publiModifee);
|
- |
|
220 |
store.insert(publiModifee, indexElementSelectionne);
|
- |
|
221 |
grille.repaint();
|
- |
|
222 |
grille.getSelectionModel().select(indexElementSelectionne, true);
|
- |
|
223 |
clicListe(publiModifee);
|
209 |
} else if (info.getType().equals("suppression_publication")) {
|
224 |
} else if (info.getType().equals("suppression_publication")) {
|
210 |
InfoLogger.display(i18nC.publicationTitreSuppression(), info.getMessages().toString());
|
225 |
InfoLogger.display(i18nC.publicationTitreSuppression(), info.getMessages().toString());
|
211 |
supprimerPublicationsSelectionnees();
|
226 |
supprimerPublicationsSelectionnees();
|
212 |
gererEtatActivationBouton();
|
227 |
gererEtatActivationBouton();
|
213 |
}
|
228 |
}
|