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;
|
9 |
benjamin |
14 |
|
|
|
15 |
import com.google.gwt.event.shared.HandlerManager;
|
|
|
16 |
import com.google.gwt.user.client.History;
|
|
|
17 |
|
14 |
benjamin |
18 |
public class BusEvenementiel extends HandlerManager {
|
9 |
benjamin |
19 |
|
14 |
benjamin |
20 |
private static BusEvenementiel instance;
|
9 |
benjamin |
21 |
|
14 |
benjamin |
22 |
private BusEvenementiel() {
|
9 |
benjamin |
23 |
super(null);
|
|
|
24 |
instance = this;
|
233 |
gduche |
25 |
creerHandler();
|
9 |
benjamin |
26 |
}
|
|
|
27 |
|
14 |
benjamin |
28 |
public static BusEvenementiel getInstance() {
|
9 |
benjamin |
29 |
if (instance == null) {
|
14 |
benjamin |
30 |
instance = new BusEvenementiel();
|
9 |
benjamin |
31 |
}
|
|
|
32 |
return instance;
|
|
|
33 |
}
|
|
|
34 |
|
233 |
gduche |
35 |
private void creerHandler() {
|
14 |
benjamin |
36 |
addHandler(EvenementValidation.TYPE, new GestionnaireEvenementValidation() {
|
9 |
benjamin |
37 |
|
|
|
38 |
@Override
|
332 |
gduche |
39 |
public void onValidationObservation(EvenementValidation event) {
|
|
|
40 |
doValidationObservation(event.getObservation());
|
73 |
benjamin |
41 |
}
|
|
|
42 |
});
|
9 |
benjamin |
43 |
|
73 |
benjamin |
44 |
addHandler(EvenementComparaisonEflore.TYPE, new GestionnaireEvenementComparaisonEflore() {
|
|
|
45 |
|
|
|
46 |
@Override
|
|
|
47 |
public void onComparaisonEflore(EvenementComparaisonEflore event) {
|
|
|
48 |
doComparaisonAvecEflore(event.getTaxonDemande());
|
9 |
benjamin |
49 |
}
|
|
|
50 |
});
|
147 |
benjamin |
51 |
|
|
|
52 |
addHandler(EvenementRechercheImage.TYPE, new GestionnaireEvenementRechercheImage() {
|
360 |
benjamin |
53 |
|
147 |
benjamin |
54 |
@Override
|
|
|
55 |
public void onRechercheImage(EvenementRechercheImage event) {
|
311 |
gduche |
56 |
doRechercheImage();
|
147 |
benjamin |
57 |
}
|
|
|
58 |
});
|
178 |
benjamin |
59 |
|
335 |
benjamin |
60 |
addHandler(EvenementRechercheObservation.TYPE, new GestionnaireEvenementRechercheObservation() {
|
|
|
61 |
|
|
|
62 |
@Override
|
|
|
63 |
public void onRechercheObservation(EvenementRechercheObservation event) {
|
|
|
64 |
doRechercheObservation();
|
|
|
65 |
}
|
|
|
66 |
});
|
|
|
67 |
|
9 |
benjamin |
68 |
}
|
|
|
69 |
|
332 |
gduche |
70 |
private void doValidationObservation(Observation observation) {
|
|
|
71 |
CacheClient.getInstance().setObservationCourante(observation);
|
73 |
benjamin |
72 |
History.newItem(ConstantesNavigation.PAGE_VALIDATION, true);
|
9 |
benjamin |
73 |
}
|
|
|
74 |
|
73 |
benjamin |
75 |
private void doComparaisonAvecEflore(String taxon) {
|
|
|
76 |
CacheClient.getInstance().setTaxonPourRechercheEflore(taxon);
|
|
|
77 |
History.newItem(ConstantesNavigation.PAGE_COMPARAISON_EFLORE, true);
|
|
|
78 |
}
|
|
|
79 |
|
311 |
gduche |
80 |
private void doRechercheImage() {
|
335 |
benjamin |
81 |
History.newItem(ConstantesNavigation.PAGE_RECHERCHE_IMAGES, true);
|
147 |
benjamin |
82 |
}
|
359 |
benjamin |
83 |
|
335 |
benjamin |
84 |
private void doRechercheObservation() {
|
|
|
85 |
History.newItem(ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS, true);
|
|
|
86 |
}
|
147 |
benjamin |
87 |
|
9 |
benjamin |
88 |
}
|