15 |
benjamin |
1 |
package org.tela_botanica.del.client.navigation.evenement;
|
9 |
benjamin |
2 |
|
14 |
benjamin |
3 |
import org.tela_botanica.del.client.cache.CacheClient;
|
22 |
aurelien |
4 |
import org.tela_botanica.del.client.gestionhistorique.ConstantesNavigation;
|
332 |
gduche |
5 |
import org.tela_botanica.del.client.modeles.Observation;
|
73 |
benjamin |
6 |
import org.tela_botanica.del.client.navigation.evenement.comparaisoneflore.EvenementComparaisonEflore;
|
|
|
7 |
import org.tela_botanica.del.client.navigation.evenement.comparaisoneflore.GestionnaireEvenementComparaisonEflore;
|
359 |
benjamin |
8 |
import org.tela_botanica.del.client.navigation.evenement.detailsimage.EvenementRechercheImage;
|
|
|
9 |
import org.tela_botanica.del.client.navigation.evenement.detailsimage.GestionnaireEvenementRechercheImage;
|
335 |
benjamin |
10 |
import org.tela_botanica.del.client.navigation.evenement.rechercheobservation.EvenementRechercheObservation;
|
|
|
11 |
import org.tela_botanica.del.client.navigation.evenement.rechercheobservation.GestionnaireEvenementRechercheObservation;
|
15 |
benjamin |
12 |
import org.tela_botanica.del.client.navigation.evenement.validationobservation.EvenementValidation;
|
|
|
13 |
import org.tela_botanica.del.client.navigation.evenement.validationobservation.GestionnaireEvenementValidation;
|
1196 |
gduche |
14 |
import org.tela_botanica.del.client.navigation.evenement.validationobservationpictoflora.EvenementValidationPictoflora;
|
|
|
15 |
import org.tela_botanica.del.client.navigation.evenement.validationobservationpictoflora.GestionnaireEvenementValidationPictoflora;
|
9 |
benjamin |
16 |
|
|
|
17 |
import com.google.gwt.event.shared.HandlerManager;
|
|
|
18 |
import com.google.gwt.user.client.History;
|
|
|
19 |
|
14 |
benjamin |
20 |
public class BusEvenementiel extends HandlerManager {
|
9 |
benjamin |
21 |
|
14 |
benjamin |
22 |
private static BusEvenementiel instance;
|
1129 |
gduche |
23 |
private CacheClient cache;
|
|
|
24 |
|
14 |
benjamin |
25 |
private BusEvenementiel() {
|
9 |
benjamin |
26 |
super(null);
|
|
|
27 |
instance = this;
|
233 |
gduche |
28 |
creerHandler();
|
1129 |
gduche |
29 |
this.cache = CacheClient.getInstance();
|
9 |
benjamin |
30 |
}
|
|
|
31 |
|
14 |
benjamin |
32 |
public static BusEvenementiel getInstance() {
|
9 |
benjamin |
33 |
if (instance == null) {
|
14 |
benjamin |
34 |
instance = new BusEvenementiel();
|
9 |
benjamin |
35 |
}
|
|
|
36 |
return instance;
|
|
|
37 |
}
|
|
|
38 |
|
233 |
gduche |
39 |
private void creerHandler() {
|
14 |
benjamin |
40 |
addHandler(EvenementValidation.TYPE, new GestionnaireEvenementValidation() {
|
9 |
benjamin |
41 |
|
|
|
42 |
@Override
|
332 |
gduche |
43 |
public void onValidationObservation(EvenementValidation event) {
|
|
|
44 |
doValidationObservation(event.getObservation());
|
1129 |
gduche |
45 |
cache.setPageCourante(ConstantesNavigation.PAGE_VALIDATION);
|
73 |
benjamin |
46 |
}
|
|
|
47 |
});
|
1196 |
gduche |
48 |
|
|
|
49 |
addHandler(EvenementValidationPictoflora.TYPE, new GestionnaireEvenementValidationPictoflora() {
|
|
|
50 |
|
|
|
51 |
@Override
|
|
|
52 |
public void onValidationObservation(EvenementValidationPictoflora event) {
|
|
|
53 |
doValidationObservationPictoflora(event.getObservation());
|
|
|
54 |
cache.setPageCourante(ConstantesNavigation.PAGE_VALIDATION_PICTOFLORA);
|
|
|
55 |
}
|
|
|
56 |
});
|
|
|
57 |
|
73 |
benjamin |
58 |
addHandler(EvenementComparaisonEflore.TYPE, new GestionnaireEvenementComparaisonEflore() {
|
|
|
59 |
|
|
|
60 |
@Override
|
|
|
61 |
public void onComparaisonEflore(EvenementComparaisonEflore event) {
|
|
|
62 |
doComparaisonAvecEflore(event.getTaxonDemande());
|
1129 |
gduche |
63 |
cache.setPageCourante(ConstantesNavigation.PAGE_COMPARAISON_EFLORE);
|
9 |
benjamin |
64 |
}
|
|
|
65 |
});
|
147 |
benjamin |
66 |
|
|
|
67 |
addHandler(EvenementRechercheImage.TYPE, new GestionnaireEvenementRechercheImage() {
|
360 |
benjamin |
68 |
|
147 |
benjamin |
69 |
@Override
|
|
|
70 |
public void onRechercheImage(EvenementRechercheImage event) {
|
311 |
gduche |
71 |
doRechercheImage();
|
1129 |
gduche |
72 |
cache.setPageCourante(ConstantesNavigation.PAGE_RECHERCHE_IMAGES);
|
147 |
benjamin |
73 |
}
|
|
|
74 |
});
|
178 |
benjamin |
75 |
|
335 |
benjamin |
76 |
addHandler(EvenementRechercheObservation.TYPE, new GestionnaireEvenementRechercheObservation() {
|
|
|
77 |
|
|
|
78 |
@Override
|
|
|
79 |
public void onRechercheObservation(EvenementRechercheObservation event) {
|
|
|
80 |
doRechercheObservation();
|
1129 |
gduche |
81 |
cache.setPageCourante(ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS);
|
335 |
benjamin |
82 |
}
|
|
|
83 |
});
|
|
|
84 |
|
9 |
benjamin |
85 |
}
|
|
|
86 |
|
332 |
gduche |
87 |
private void doValidationObservation(Observation observation) {
|
|
|
88 |
CacheClient.getInstance().setObservationCourante(observation);
|
1035 |
benjamin |
89 |
History.newItem(ConstantesNavigation.PAGE_VALIDATION + "~" + observation.getId(), true);
|
9 |
benjamin |
90 |
}
|
1196 |
gduche |
91 |
|
|
|
92 |
private void doValidationObservationPictoflora(Observation observation) {
|
|
|
93 |
CacheClient.getInstance().setObservationCourante(observation);
|
|
|
94 |
History.newItem(ConstantesNavigation.PAGE_VALIDATION_PICTOFLORA + "~" + observation.getId(), true);
|
|
|
95 |
}
|
9 |
benjamin |
96 |
|
73 |
benjamin |
97 |
private void doComparaisonAvecEflore(String taxon) {
|
|
|
98 |
History.newItem(ConstantesNavigation.PAGE_COMPARAISON_EFLORE, true);
|
|
|
99 |
}
|
|
|
100 |
|
311 |
gduche |
101 |
private void doRechercheImage() {
|
335 |
benjamin |
102 |
History.newItem(ConstantesNavigation.PAGE_RECHERCHE_IMAGES, true);
|
147 |
benjamin |
103 |
}
|
359 |
benjamin |
104 |
|
1091 |
gduche |
105 |
private void doRechercheObservation() {
|
335 |
benjamin |
106 |
History.newItem(ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS, true);
|
|
|
107 |
}
|
147 |
benjamin |
108 |
|
9 |
benjamin |
109 |
}
|