22,6 → 22,8 |
import org.tela_botanica.client.modeles.collection.CollectionAPublication; |
import org.tela_botanica.client.modeles.collection.CollectionAPublicationListe; |
import org.tela_botanica.client.modeles.collection.CollectionListe; |
import org.tela_botanica.client.modeles.commentaire.Commentaire; |
import org.tela_botanica.client.modeles.commentaire.CommentaireListe; |
import org.tela_botanica.client.modeles.personne.Personne; |
import org.tela_botanica.client.modeles.personne.PersonneListe; |
import org.tela_botanica.client.modeles.projet.Projet; |
48,6 → 50,7 |
import org.tela_botanica.client.vues.collection.CollectionForm; |
import org.tela_botanica.client.vues.collection.CollectionListeVue; |
import org.tela_botanica.client.vues.collection.CollectionVue; |
import org.tela_botanica.client.vues.commentaire.CommentaireVue; |
import org.tela_botanica.client.vues.personne.PersonneForm; |
import org.tela_botanica.client.vues.personne.PersonneVue; |
import org.tela_botanica.client.vues.projet.ProjetForm; |
214,6 → 217,8 |
selectionnerPersonne(panneauCentre, null, null); |
} else if (codeMenuClique.equals(MenuApplicationId.PUBLICATION)) { |
selectionnerPublication(panneauCentre, null); |
} else if (codeMenuClique.equals(MenuApplicationId.COMMENTAIRE)) { |
selectionnerCommentaire(panneauCentre, null); |
} else { |
GWT.log(i18nM.nonImplemente(codeMenuClique), null); |
} |
1056,6 → 1061,100 |
} |
|
//+----------------------------------------------------------------------------------------------------------------+ |
// GESTION DES COMMENTAIRES |
//+----------------------------------------------------------------------------------------------------------------+ |
|
public void afficherListeCommentaire(CommentaireListe nouvelleDonnees) { |
if (!(panneauCentre.getContenu() instanceof CommentaireVue)) { |
panneauCentre.removeAll(); |
panneauCentre.add(new CommentaireVue(this)); |
} |
|
panneauCentre.getContenu().rafraichir(nouvelleDonnees); |
} |
|
public void afficherFormCommentaire(String commentaireId) { |
panneauCentre.removeAll(); |
PublicationForm commentaireForm = new PublicationForm(this, commentaireId); |
panneauCentre.add(commentaireForm); |
|
panneauCentre.layout(); |
} |
|
public void clicListeCommentaire(Commentaire commentaire) { |
if (commentaire != null) { |
panneauCentre.getContenu().rafraichir(commentaire); |
} |
} |
|
public void clicAjouterCommentaire() { |
afficherFormCommentaire(null); |
} |
|
public void clicModifierCommentaire(List<Commentaire> selection) { |
if (selection.size() == 0) { |
Info.display("Information", "Veuillez sélectionner un commentaire."); |
} else if (selection.size() > 1) { |
Info.display("Information", "Veuillez sélectionner un seul commentaire à la fois."); |
} else if (selection.size() == 1) { |
afficherFormCommentaire(selection.get(0).getId()); |
} else { |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierCommentaire() du Médiateur."); |
} |
} |
|
public void clicSupprimerCommentaire(final List<Commentaire> commentaireListe) { |
if (commentaireListe.size() <= 0) { |
MessageBox.alert("Attention", "Vous devez sélectionner un commentaire", null); |
} else { |
String message = "Voulez-vous vraiment supprimer ces commentaires ?"; |
if (commentaireListe.size() == 1) { |
message = "Voulez-vous vraiment supprimer ce commentaire ?"; |
} |
|
final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() { |
public void handleEvent(MessageBoxEvent ce) { |
Dialog dialog = (Dialog) ce.getComponent(); |
Button btn = ce.getButtonClicked(); |
|
if (btn.getText().equals(dialog.yesText)) { |
supprimerCommentaire(panneauCentre.getContenu(), commentaireListe); |
} |
} |
}; |
|
MessageBox.confirm("Supprimer un commentaire", message, listenerSuppression); |
} |
} |
|
public void selectionnerCommentaire(Rafraichissable vueARafraichir, String commentaireId) { |
modele.selectionnerCommentaire(vueARafraichir, commentaireId, getProjetId()); |
} |
|
public void ajouterCommentaire(Rafraichissable vueARafraichir, Commentaire commentaire) { |
modele.ajouterCommentaire(vueARafraichir, commentaire); |
} |
|
public void modifierCommentaire(Rafraichissable vueARafraichir, Commentaire commentaire) { |
modele.modifierCommentaire(vueARafraichir, commentaire); |
} |
|
public void supprimerCommentaire(Rafraichissable vueARafraichir, List<Commentaire> commentairesListe) { |
if (commentairesListe != null && commentairesListe.size() > 0) { |
String idCommentaireSeparesParVirgule = "" ; |
Iterator<Commentaire> it = commentairesListe.iterator(); |
while (it.hasNext()) { |
idCommentaireSeparesParVirgule += it.next().getId(); |
if (it.hasNext()) { |
idCommentaireSeparesParVirgule += ","; |
} |
} |
modele.supprimerCommentaire(vueARafraichir, idCommentaireSeparesParVirgule); |
//modele.supprimerCollectionACommentaire(vueARafraichir, idCommentaireSeparesParVirgule); |
} |
} |
|
//+----------------------------------------------------------------------------------------------------------------+ |
// RAFRAICHISSEMENT |
//+----------------------------------------------------------------------------------------------------------------+ |
|