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