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());
|
73 |
benjamin |
45 |
}
|
|
|
46 |
});
|
1196 |
gduche |
47 |
|
|
|
48 |
addHandler(EvenementValidationPictoflora.TYPE, new GestionnaireEvenementValidationPictoflora() {
|
|
|
49 |
|
|
|
50 |
@Override
|
|
|
51 |
public void onValidationObservation(EvenementValidationPictoflora event) {
|
|
|
52 |
doValidationObservationPictoflora(event.getObservation());
|
|
|
53 |
}
|
|
|
54 |
});
|
|
|
55 |
|
73 |
benjamin |
56 |
addHandler(EvenementComparaisonEflore.TYPE, new GestionnaireEvenementComparaisonEflore() {
|
|
|
57 |
|
|
|
58 |
@Override
|
|
|
59 |
public void onComparaisonEflore(EvenementComparaisonEflore event) {
|
|
|
60 |
doComparaisonAvecEflore(event.getTaxonDemande());
|
9 |
benjamin |
61 |
}
|
|
|
62 |
});
|
147 |
benjamin |
63 |
|
|
|
64 |
addHandler(EvenementRechercheImage.TYPE, new GestionnaireEvenementRechercheImage() {
|
360 |
benjamin |
65 |
|
147 |
benjamin |
66 |
@Override
|
|
|
67 |
public void onRechercheImage(EvenementRechercheImage event) {
|
1553 |
jpm |
68 |
History.newItem("", true);
|
|
|
69 |
cache.setPageCourante("");
|
147 |
benjamin |
70 |
}
|
|
|
71 |
});
|
178 |
benjamin |
72 |
|
335 |
benjamin |
73 |
addHandler(EvenementRechercheObservation.TYPE, new GestionnaireEvenementRechercheObservation() {
|
|
|
74 |
|
|
|
75 |
@Override
|
|
|
76 |
public void onRechercheObservation(EvenementRechercheObservation event) {
|
1553 |
jpm |
77 |
History.newItem("", true);
|
|
|
78 |
cache.setPageCourante("");
|
335 |
benjamin |
79 |
}
|
|
|
80 |
});
|
|
|
81 |
|
9 |
benjamin |
82 |
}
|
|
|
83 |
|
332 |
gduche |
84 |
private void doValidationObservation(Observation observation) {
|
|
|
85 |
CacheClient.getInstance().setObservationCourante(observation);
|
1549 |
jpm |
86 |
History.newItem(ConstantesNavigation.PAGE_DETAIL_OBS + "~" + observation.getId(), true);
|
9 |
benjamin |
87 |
}
|
1196 |
gduche |
88 |
|
|
|
89 |
private void doValidationObservationPictoflora(Observation observation) {
|
|
|
90 |
CacheClient.getInstance().setObservationCourante(observation);
|
1549 |
jpm |
91 |
History.newItem(ConstantesNavigation.PAGE_DETAIL_IMG + "~" + observation.getId(), true);
|
1196 |
gduche |
92 |
}
|
9 |
benjamin |
93 |
|
73 |
benjamin |
94 |
private void doComparaisonAvecEflore(String taxon) {
|
|
|
95 |
History.newItem(ConstantesNavigation.PAGE_COMPARAISON_EFLORE, true);
|
|
|
96 |
}
|
9 |
benjamin |
97 |
}
|