| Line 202... |
Line 202... |
| 202 |
activerChargement(codeMenuClique);
|
202 |
activerChargement(codeMenuClique);
|
| 203 |
panneauOuest.selectionMenu(codeMenuClique);
|
203 |
panneauOuest.selectionMenu(codeMenuClique);
|
| 204 |
if (codeMenuClique.equals(MenuApplicationId.ACCUEIL)) {
|
204 |
if (codeMenuClique.equals(MenuApplicationId.ACCUEIL)) {
|
| 205 |
afficherAccueil();
|
205 |
afficherAccueil();
|
| 206 |
} else if (codeMenuClique.equals(MenuApplicationId.PROJET)) {
|
206 |
} else if (codeMenuClique.equals(MenuApplicationId.PROJET)) {
|
| 207 |
selectionnerProjets(panneauCentre);
|
207 |
selectionnerProjet(panneauCentre, null);
|
| 208 |
} else if (codeMenuClique.equals(MenuApplicationId.STRUCTURE)) {
|
208 |
} else if (codeMenuClique.equals(MenuApplicationId.STRUCTURE)) {
|
| 209 |
selectionnerStructure(panneauCentre, null);
|
209 |
selectionnerStructure(panneauCentre, null);
|
| 210 |
} else if (codeMenuClique.equals(MenuApplicationId.COLLECTION)) {
|
210 |
} else if (codeMenuClique.equals(MenuApplicationId.COLLECTION)) {
|
| 211 |
selectionnerCollection(panneauCentre, null);
|
211 |
selectionnerCollection(panneauCentre, null);
|
| 212 |
} else if (codeMenuClique.equals(MenuApplicationId.PERSONNE)) {
|
212 |
} else if (codeMenuClique.equals(MenuApplicationId.PERSONNE)) {
|
| Line 355... |
Line 355... |
| 355 |
|
355 |
|
| 356 |
//+----------------------------------------------------------------------------------------------------------------+
|
356 |
//+----------------------------------------------------------------------------------------------------------------+
|
| 357 |
// GESTION des PROJETS
|
357 |
// GESTION des PROJETS
|
| Line -... |
Line 358... |
| - |
|
358 |
//+----------------------------------------------------------------------------------------------------------------+
|
| - |
|
359 |
|
| - |
|
360 |
public void afficherFormProjet(String projetId) {
|
| - |
|
361 |
panneauCentre.removeAll();
|
| - |
|
362 |
ProjetForm projetForm = new ProjetForm(this, projetId);
|
| - |
|
363 |
panneauCentre.add(projetForm);
|
| - |
|
364 |
|
| - |
|
365 |
panneauCentre.layout();
|
| - |
|
366 |
}
|
| - |
|
367 |
|
| - |
|
368 |
public void afficherListeProjets(ProjetListe projetsACharger) {
|
| - |
|
369 |
if (!(panneauCentre.getContenu() instanceof ProjetVue)) {
|
| - |
|
370 |
panneauCentre.removeAll();
|
| - |
|
371 |
panneauCentre.add(new ProjetVue(this));
|
| - |
|
372 |
panneauCentre.setId(ComposantId.PANNEAU_PROJET_LISTE);
|
| - |
|
373 |
panneauCentre.layout();
|
| - |
|
374 |
}
|
| - |
|
375 |
|
| - |
|
376 |
panneauCentre.getContenu().rafraichir(projetsACharger);
|
| - |
|
377 |
}
|
| - |
|
378 |
|
| - |
|
379 |
public void clicListeProjet(Projet projet) {
|
| - |
|
380 |
panneauCentre.getContenu().rafraichir(projet);
|
| - |
|
381 |
}
|
| - |
|
382 |
|
| - |
|
383 |
public void clicSupprimerProjet(final List<Projet> projetListe) {
|
| - |
|
384 |
if (projetListe.size() <= 0) {
|
| - |
|
385 |
MessageBox.alert("Attention", "Vous devez sélectionner un projet", null);
|
| - |
|
386 |
} else {
|
| - |
|
387 |
String message = "Voulez-vous vraiment supprimer ces projets ?";
|
| - |
|
388 |
if (projetListe.size() == 1) {
|
| - |
|
389 |
message = "Voulez-vous vraiment supprimer ce projet ?";
|
| - |
|
390 |
}
|
| - |
|
391 |
|
| - |
|
392 |
final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() {
|
| - |
|
393 |
public void handleEvent(MessageBoxEvent ce) {
|
| - |
|
394 |
Dialog dialog = (Dialog) ce.getComponent();
|
| - |
|
395 |
Button btn = ce.getButtonClicked();
|
| - |
|
396 |
|
| - |
|
397 |
if (btn.getText().equals(dialog.yesText)) {
|
| - |
|
398 |
modele.supprimerProjet(panneauCentre.getContenu(), projetListe);
|
| - |
|
399 |
}
|
| - |
|
400 |
}
|
| - |
|
401 |
};
|
| - |
|
402 |
|
| - |
|
403 |
MessageBox.confirm("Supprimer un projet", message, listenerSuppression);
|
| - |
|
404 |
}
|
| - |
|
405 |
|
| - |
|
406 |
}
|
| - |
|
407 |
|
| - |
|
408 |
public void clicModifierProjet(List<Projet> projetsSelectionnes) {
|
| - |
|
409 |
if (projetsSelectionnes.size() == 0) {
|
| - |
|
410 |
Info.display("Information", "Veuillez sélectionner un projet.");
|
| - |
|
411 |
} else if (projetsSelectionnes.size() > 1) {
|
| - |
|
412 |
Info.display("Information", "Veuillez sélectionner un seul projet à la fois.");
|
| - |
|
413 |
} else if (projetsSelectionnes.size() == 1) {
|
| - |
|
414 |
afficherFormProjet(projetsSelectionnes.get(0).getId());
|
| - |
|
415 |
} else {
|
| - |
|
416 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierProjet() du Médiateur.");
|
| - |
|
417 |
}
|
| - |
|
418 |
}
|
| - |
|
419 |
|
| - |
|
420 |
public void clicAjouterProjet() {
|
| - |
|
421 |
afficherFormProjet(null);
|
| - |
|
422 |
}
|
| - |
|
423 |
|
| - |
|
424 |
public void selectionnerProjet(Rafraichissable vueARafraichir, String projetId) {
|
| - |
|
425 |
modele.selectionnerProjet(vueARafraichir, projetId);
|
| - |
|
426 |
}
|
| - |
|
427 |
|
| - |
|
428 |
public void ajouterProjet(Rafraichissable vueARafraichir, Projet projetCollecte) {
|
| - |
|
429 |
modele.ajouterProjet(vueARafraichir, projetCollecte);
|
| - |
|
430 |
}
|
| - |
|
431 |
|
| - |
|
432 |
public void modifierProjet(Rafraichissable vueARafraichir, Projet projetCollecte) {
|
| - |
|
433 |
modele.modifierProjet(vueARafraichir, projetCollecte);
|
| - |
|
434 |
}
|
| - |
|
435 |
|
| 358 |
//+----------------------------------------------------------------------------------------------------------------+
|
436 |
//+----------------------------------------------------------------------------------------------------------------+
|
| 359 |
|
437 |
// SELECTION : projet
|
| 360 |
/**
|
438 |
/**
|
| 361 |
* Retourne l'identifiant du projet courrant de l'application.
|
439 |
* Retourne l'identifiant du projet courrant de l'application.
|
| 362 |
*/
|
440 |
*/
|
| Line 366... |
Line 444... |
| 366 |
if (projetCourant != null && !projetCourant.getId().equals("")) {
|
444 |
if (projetCourant != null && !projetCourant.getId().equals("")) {
|
| 367 |
id = projetCourant.getId();
|
445 |
id = projetCourant.getId();
|
| 368 |
}
|
446 |
}
|
| 369 |
return id;
|
447 |
return id;
|
| 370 |
}
|
448 |
}
|
| 371 |
|
449 |
|
| 372 |
//Greg : ajout d'un écouteur pour le changement liste projet
|
- |
|
| 373 |
public void selectionnerProjets(Rafraichissable vueARafraichir) {
|
- |
|
| 374 |
modele.selectionnerProjets(vueARafraichir);
|
- |
|
| 375 |
}
|
- |
|
| 376 |
|
- |
|
| 377 |
public void selectionnerProjetCourant(Projet projetSelectionne) {
|
450 |
public void selectionnerProjetCourant(Projet projetSelectionne) {
|
| 378 |
Registry.register(RegistreId.PROJET_COURANT, projetSelectionne);
|
451 |
Registry.register(RegistreId.PROJET_COURANT, projetSelectionne);
|
| 379 |
if (panneauCentre.getContenu() instanceof PersonneVue) {
|
452 |
if (panneauCentre.getContenu() instanceof ProjetVue) {
|
| 380 |
//modele.selectionnerPersonne(contenuPanneauCentre, null, getProjetId(), null);
|
- |
|
| 381 |
selectionnerPersonne(panneauCentre, null, getProjetId());
|
453 |
selectionnerProjet(panneauCentre.getContenu(), null);
|
| 382 |
//FIXME Le rafraichissement du panneau ne se fait pas!
|
- |
|
| 383 |
} else if (panneauCentre.getContenu() instanceof StructureVue) {
|
454 |
} else if (panneauCentre.getContenu() instanceof StructureVue) {
|
| 384 |
modele.selectionnerStructure(panneauCentre.getContenu(), getProjetId(), null);
|
455 |
selectionnerStructure(panneauCentre.getContenu(), null);
|
| 385 |
} else if (panneauCentre.getContenu() instanceof CollectionVue) {
|
456 |
} else if (panneauCentre.getContenu() instanceof CollectionVue) {
|
| 386 |
modele.selectionnerCollection(panneauCentre.getContenu(), getProjetId(), null);
|
457 |
selectionnerCollection(panneauCentre.getContenu(), null);
|
| - |
|
458 |
} else if (panneauCentre.getContenu() instanceof PersonneVue) {
|
| - |
|
459 |
selectionnerPersonne(panneauCentre.getContenu(), null, getProjetId());
|
| - |
|
460 |
} else if (panneauCentre.getContenu() instanceof PublicationVue) {
|
| - |
|
461 |
selectionnerPublication(panneauCentre.getContenu(), null);
|
| 387 |
}
|
462 |
}
|
| 388 |
}
|
463 |
}
|
| Line -... |
Line 464... |
| - |
|
464 |
|
| 389 |
|
465 |
|
| 390 |
//+----------------------------------------------------------------------------------------------------------------+
|
466 |
//+----------------------------------------------------------------------------------------------------------------+
|
| 391 |
// GESTION DES STRUCTURES
|
467 |
// GESTION DES STRUCTURES
|
| Line 392... |
Line 468... |
| 392 |
//+----------------------------------------------------------------------------------------------------------------+
|
468 |
//+----------------------------------------------------------------------------------------------------------------+
|
| Line 969... |
Line 1045... |
| 969 |
}
|
1045 |
}
|
| Line 970... |
Line 1046... |
| 970 |
|
1046 |
|
| 971 |
public void masquerPopinChargement() {
|
1047 |
public void masquerPopinChargement() {
|
| 972 |
((PopupChargement) Registry.get(RegistreId.POPUP_CHARGEMENT)).hide();
|
1048 |
((PopupChargement) Registry.get(RegistreId.POPUP_CHARGEMENT)).hide();
|
| 973 |
}
|
- |
|
| 974 |
|
- |
|
| 975 |
public void afficherFormProjet(String projetId) {
|
- |
|
| 976 |
panneauCentre.removeAll();
|
- |
|
| 977 |
ProjetForm projetForm = new ProjetForm(this, projetId);
|
- |
|
| 978 |
panneauCentre.add(projetForm);
|
- |
|
| 979 |
|
- |
|
| 980 |
panneauCentre.layout();
|
- |
|
| 981 |
}
|
- |
|
| 982 |
|
- |
|
| 983 |
public void afficherListeProjets(ProjetListe projetsACharger) {
|
- |
|
| 984 |
if (!(panneauCentre.getContenu() instanceof ProjetVue)) {
|
- |
|
| 985 |
panneauCentre.removeAll();
|
- |
|
| 986 |
panneauCentre.add(new ProjetVue(this));
|
- |
|
| 987 |
panneauCentre.setId(ComposantId.PANNEAU_PROJET_LISTE);
|
- |
|
| 988 |
panneauCentre.layout();
|
- |
|
| 989 |
}
|
- |
|
| 990 |
|
- |
|
| 991 |
panneauCentre.getContenu().rafraichir(projetsACharger);
|
- |
|
| 992 |
}
|
- |
|
| 993 |
|
- |
|
| 994 |
|
- |
|
| 995 |
//+----------------------------------------------------------------------------------------------------------------+
|
- |
|
| 996 |
// GESTION des projets
|
- |
|
| 997 |
//+----------------------------------------------------------------------------------------------------------------+
|
- |
|
| 998 |
public void clicListeProjet(Projet projet) {
|
- |
|
| 999 |
panneauCentre.getContenu().rafraichir(projet);
|
- |
|
| 1000 |
}
|
- |
|
| 1001 |
|
- |
|
| 1002 |
public void clicSupprimerProjet(final List<Projet> projetListe) {
|
- |
|
| 1003 |
if (projetListe.size() <= 0) {
|
- |
|
| 1004 |
MessageBox.alert("Attention", "Vous devez sélectionner un projet", null);
|
- |
|
| 1005 |
} else {
|
- |
|
| 1006 |
String message = "Voulez-vous vraiment supprimer ces projets ?";
|
- |
|
| 1007 |
if (projetListe.size() == 1) {
|
- |
|
| 1008 |
message = "Voulez-vous vraiment supprimer ce projet ?";
|
- |
|
| 1009 |
}
|
- |
|
| 1010 |
|
- |
|
| 1011 |
final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() {
|
- |
|
| 1012 |
public void handleEvent(MessageBoxEvent ce) {
|
- |
|
| 1013 |
Dialog dialog = (Dialog) ce.getComponent();
|
- |
|
| 1014 |
Button btn = ce.getButtonClicked();
|
- |
|
| 1015 |
|
- |
|
| 1016 |
if (btn.getText().equals(dialog.yesText)) {
|
- |
|
| 1017 |
modele.supprimerProjet(panneauCentre.getContenu(), projetListe);
|
- |
|
| 1018 |
}
|
- |
|
| 1019 |
}
|
- |
|
| 1020 |
};
|
- |
|
| 1021 |
|
- |
|
| 1022 |
MessageBox.confirm("Supprimer un projet", message, listenerSuppression);
|
- |
|
| 1023 |
}
|
- |
|
| 1024 |
|
- |
|
| 1025 |
}
|
- |
|
| 1026 |
|
- |
|
| 1027 |
public void clicModifierProjet(List<Projet> projetsSelectionnes) {
|
- |
|
| 1028 |
if (projetsSelectionnes.size() == 0) {
|
- |
|
| 1029 |
Info.display("Information", "Veuillez sélectionner un projet.");
|
- |
|
| 1030 |
} else if (projetsSelectionnes.size() > 1) {
|
- |
|
| 1031 |
Info.display("Information", "Veuillez sélectionner un seul projet à la fois.");
|
- |
|
| 1032 |
} else if (projetsSelectionnes.size() == 1) {
|
- |
|
| 1033 |
afficherFormProjet(projetsSelectionnes.get(0).getId());
|
- |
|
| 1034 |
} else {
|
- |
|
| 1035 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierProjet() du Médiateur.");
|
- |
|
| 1036 |
}
|
- |
|
| 1037 |
}
|
- |
|
| 1038 |
|
- |
|
| 1039 |
public void clicAjouterProjet() {
|
- |
|
| 1040 |
afficherFormProjet(null);
|
- |
|
| 1041 |
}
|
- |
|
| 1042 |
|
- |
|
| 1043 |
public void selectionnerProjet(Rafraichissable vueARafraichir, String projetId) {
|
- |
|
| 1044 |
modele.selectionnerProjet(vueARafraichir, projetId);
|
- |
|
| 1045 |
}
|
- |
|
| 1046 |
|
- |
|
| 1047 |
public void ajouterProjet(Rafraichissable vueARafraichir, Projet projetCollecte) {
|
- |
|
| 1048 |
modele.ajouterProjet(vueARafraichir, projetCollecte);
|
- |
|
| 1049 |
}
|
- |
|
| 1050 |
|
- |
|
| 1051 |
public void modifierProjet(Rafraichissable vueARafraichir, Projet projetCollecte) {
|
- |
|
| 1052 |
modele.modifierProjet(vueARafraichir, projetCollecte);
|
- |
|
| Line 1053... |
Line 1049... |
| 1053 |
}
|
1049 |
}
|
| 1054 |
|
1050 |
|