Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1098 Rev 1239
Line 3... Line 3...
3
import java.util.ArrayList;
3
import java.util.ArrayList;
4
import java.util.List;
4
import java.util.List;
Line 5... Line 5...
5
 
5
 
6
import org.tela_botanica.client.Mediateur;
6
import org.tela_botanica.client.Mediateur;
-
 
7
import org.tela_botanica.client.composants.ChampComboBoxMultiSelect;
7
import org.tela_botanica.client.composants.ChampComboBoxMultiSelect;
8
import org.tela_botanica.client.composants.InfoLogger;
8
import org.tela_botanica.client.images.Images;
9
import org.tela_botanica.client.images.Images;
9
import org.tela_botanica.client.interfaces.Rafraichissable;
10
import org.tela_botanica.client.interfaces.Rafraichissable;
10
import org.tela_botanica.client.modeles.Information;
11
import org.tela_botanica.client.modeles.Information;
11
import org.tela_botanica.client.modeles.Valeur;
12
import org.tela_botanica.client.modeles.Valeur;
Line 178... Line 179...
178
		bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {  
179
		bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {  
179
			@Override  
180
			@Override  
180
			public void componentSelected(ButtonEvent ce) {  
181
			public void componentSelected(ButtonEvent ce) {  
181
				CollectionACommentaire commentaireSaisiSelectionne = grille.getSelectionModel().getSelectedItem();
182
				CollectionACommentaire commentaireSaisiSelectionne = grille.getSelectionModel().getSelectedItem();
182
				if (commentaireSaisiSelectionne == null) {
183
				if (commentaireSaisiSelectionne == null) {
183
					Info.display(i18nC.informationTitreGenerique(), i18nC.selectionnerCommentaire());
184
					InfoLogger.display(i18nC.informationTitreGenerique(), i18nC.selectionnerCommentaire());
184
				} else {
185
				} else {
185
					fenetreFormulaire = creerFenetreModaleAvecFormulaireCommentaire(Formulaire.MODE_MODIFIER);
186
					fenetreFormulaire = creerFenetreModaleAvecFormulaireCommentaire(Formulaire.MODE_MODIFIER);
186
					fenetreFormulaire.show();
187
					fenetreFormulaire.show();
187
				}
188
				}
188
			}  
189
			}  
Line 249... Line 250...
249
		bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {  
250
		bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {  
250
			@Override
251
			@Override
251
			public void componentSelected(ButtonEvent ce) {
252
			public void componentSelected(ButtonEvent ce) {
252
				CollectionACommentaire commentaireSaisiSelectionnee = grille.getSelectionModel().getSelectedItem();
253
				CollectionACommentaire commentaireSaisiSelectionnee = grille.getSelectionModel().getSelectedItem();
253
				if (commentaireSaisiSelectionnee == null) {
254
				if (commentaireSaisiSelectionnee == null) {
254
					Info.display(i18nC.informationTitreGenerique(), i18nC.selectionnerCommentaire());
255
					InfoLogger.display(i18nC.informationTitreGenerique(), i18nC.selectionnerCommentaire());
255
				} else {
256
				} else {
256
					supprimerDansGrille(commentaireSaisiSelectionnee);
257
					supprimerDansGrille(commentaireSaisiSelectionnee);
257
				}
258
				}
258
			}   
259
			}   
259
		});
260
		});
Line 543... Line 544...
543
			if (info.getDonnee(0) != null) {
544
			if (info.getDonnee(0) != null) {
544
				Commentaire commentaire = (Commentaire) info.getDonnee(0);
545
				Commentaire commentaire = (Commentaire) info.getDonnee(0);
545
				ajouterDansGrille(commentaire);
546
				ajouterDansGrille(commentaire);
546
			}
547
			}
547
		} else if (info.getType().equals("modif_collection_a_commentaire")) {
548
		} else if (info.getType().equals("modif_collection_a_commentaire")) {
548
			Info.display("Modification des notes liées à la collection", info.toString());
549
			InfoLogger.display("Modification des notes liées à la collection", info.toString());
549
			initialiserGestionCommentaires();
550
			initialiserGestionCommentaires();
550
		} else if (info.getType().equals("suppression_collection_a_commentaire")) {
551
		} else if (info.getType().equals("suppression_collection_a_commentaire")) {
551
			Info.display("Suppression des notes liées à la collection", info.toString());
552
			InfoLogger.display("Suppression des notes liées à la collection", info.toString());
552
			initialiserGestionCommentaires();
553
			initialiserGestionCommentaires();
553
		} else if (info.getType().equals("ajout_collection_a_commentaire")) {
554
		} else if (info.getType().equals("ajout_collection_a_commentaire")) {
554
			Info.display("Ajout des notes liées à la collection", info.toString());
555
			InfoLogger.display("Ajout des notes liées à la collection", info.toString());
555
			initialiserGestionCommentaires();
556
			initialiserGestionCommentaires();
556
		}
557
		}
557
	}
558
	}
Line 558... Line 559...
558
	
559
	
Line 565... Line 566...
565
	public void peupler() {
566
	public void peupler() {
566
		grille.getStore().removeAll();
567
		grille.getStore().removeAll();
567
		grille.getStore().add(collection.getCommentairesLiees().toList());
568
		grille.getStore().add(collection.getCommentairesLiees().toList());
568
		grille.recalculate();
569
		grille.recalculate();
569
		layout();
570
		layout();
570
		Info.display(i18nC.chargementCommentaire(), i18nC.ok());
571
		InfoLogger.display(i18nC.chargementCommentaire(), i18nC.ok());
571
	}
572
	}
Line 572... Line 573...
572
	
573
	
573
	public void collecter() {
574
	public void collecter() {
574
		if (etreAccede()) {
575
		if (etreAccede()) {
Line 600... Line 601...
600
	}
601
	}
Line 601... Line 602...
601
 
602
 
602
	public void soumettre() {
603
	public void soumettre() {
603
		if (mode.equals(Formulaire.MODE_MODIFIER)) {
604
		if (mode.equals(Formulaire.MODE_MODIFIER)) {
604
			if (commentairesAjoutes.size() == 0 && commentairesModifies.size() == 0 && commentairesSupprimes.size() == 0) {
605
			if (commentairesAjoutes.size() == 0 && commentairesModifies.size() == 0 && commentairesSupprimes.size() == 0) {
605
				Info.display("Modification des notes liées", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");
606
				InfoLogger.display("Modification des notes liées", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");
606
			} else {
607
			} else {
607
				mediateur.ajouterCollectionACommentaire(this, collection.getId(), commentairesAjoutes);
608
				mediateur.ajouterCollectionACommentaire(this, collection.getId(), commentairesAjoutes);
608
				mediateur.modifierCollectionACommentaire(this, commentairesModifies);
609
				mediateur.modifierCollectionACommentaire(this, commentairesModifies);
609
				mediateur.supprimerCollectionACommentaire(this, commentairesSupprimes);
610
				mediateur.supprimerCollectionACommentaire(this, commentairesSupprimes);