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