Line 1... |
Line 1... |
1 |
package org.tela_botanica.del.client.composants.moteurrecherche;
|
1 |
package org.tela_botanica.del.client.composants.moteurrecherche;
|
Line 2... |
Line 2... |
2 |
|
2 |
|
- |
|
3 |
import org.tela_botanica.del.client.cache.CacheClient;
|
3 |
import org.tela_botanica.del.client.cache.CacheClient;
|
4 |
import org.tela_botanica.del.client.composants.formulaires.AutoCompletionComboBoxPresenteur;
|
4 |
import org.tela_botanica.del.client.composants.presenteur.Presenteur;
|
5 |
import org.tela_botanica.del.client.composants.presenteur.Presenteur;
|
- |
|
6 |
import org.tela_botanica.del.client.modeles.InformationsRecherche;
|
Line 5... |
Line 7... |
5 |
import org.tela_botanica.del.client.modeles.InformationsRecherche;
|
7 |
import org.tela_botanica.del.client.services.UtilitairesAutoCompletionService;
|
6 |
|
8 |
|
7 |
import com.google.gwt.event.dom.client.ClickEvent;
|
9 |
import com.google.gwt.event.dom.client.ClickEvent;
|
8 |
import com.google.gwt.event.dom.client.ClickHandler;
|
10 |
import com.google.gwt.event.dom.client.ClickHandler;
|
9 |
import com.google.gwt.event.dom.client.HasClickHandlers;
|
11 |
import com.google.gwt.event.dom.client.HasClickHandlers;
|
10 |
import com.google.gwt.event.dom.client.HasKeyPressHandlers;
|
12 |
import com.google.gwt.event.dom.client.HasKeyPressHandlers;
|
11 |
import com.google.gwt.event.dom.client.KeyCodes;
|
13 |
import com.google.gwt.event.dom.client.KeyCodes;
|
- |
|
14 |
import com.google.gwt.event.dom.client.KeyPressEvent;
|
- |
|
15 |
import com.google.gwt.event.dom.client.KeyPressHandler;
|
- |
|
16 |
import com.google.gwt.http.client.Response;
|
- |
|
17 |
import com.google.gwt.json.client.JSONArray;
|
12 |
import com.google.gwt.event.dom.client.KeyPressEvent;
|
18 |
import com.google.gwt.json.client.JSONParser;
|
13 |
import com.google.gwt.event.dom.client.KeyPressHandler;
|
19 |
import com.google.gwt.json.client.JSONValue;
|
14 |
import com.google.gwt.user.client.ui.HasText;
|
20 |
import com.google.gwt.user.client.ui.HasText;
|
Line 15... |
Line 21... |
15 |
import com.google.gwt.user.client.ui.HasWidgets;
|
21 |
import com.google.gwt.user.client.ui.HasWidgets;
|
Line 41... |
Line 47... |
41 |
|
47 |
|
Line 42... |
Line 48... |
42 |
public HasText getDepartement();
|
48 |
public HasText getDepartement();
|
Line 43... |
Line 49... |
43 |
|
49 |
|
Line 44... |
Line 50... |
44 |
public HasText getCommune();
|
50 |
public HasText getCommune();
|
Line 45... |
Line 51... |
45 |
|
51 |
|
Line 60... |
Line 66... |
60 |
public void chargerValeursRecherchePrecedente(InformationsRecherche informationsRecherche);
|
66 |
public void chargerValeursRecherchePrecedente(InformationsRecherche informationsRecherche);
|
61 |
}
|
67 |
}
|
Line 62... |
Line 68... |
62 |
|
68 |
|
63 |
private final Vue vue;
|
69 |
private final Vue vue;
|
- |
|
70 |
private final boolean pourRechercheImages, pourRechercheObservations;
|
- |
|
71 |
|
Line 64... |
Line 72... |
64 |
private final boolean pourRechercheImages, pourRechercheObservations;
|
72 |
private AutoCompletionComboBoxPresenteur autoCompletionNomTaxonsPresenteur;
|
65 |
|
73 |
|
66 |
public MoteurRecherchePresenteur(Vue vue, boolean pourRechercheImages, boolean pourRechercheObservations) {
|
74 |
public MoteurRecherchePresenteur(Vue vue, boolean pourRechercheImages, boolean pourRechercheObservations) {
|
67 |
this.vue = vue;
|
75 |
this.vue = vue;
|
- |
|
76 |
this.pourRechercheImages = pourRechercheImages;
|
- |
|
77 |
this.pourRechercheObservations = pourRechercheObservations;
|
- |
|
78 |
|
- |
|
79 |
autoCompletionNomTaxonsPresenteur = new AutoCompletionComboBoxPresenteur(UtilitairesAutoCompletionService.urlServiceCompletionNomLocale) {
|
- |
|
80 |
|
- |
|
81 |
protected String effectuerPreTraitementChaineRequete(String requete) {
|
- |
|
82 |
return UtilitairesAutoCompletionService.effectuerPreTraitementChaineRequeteGenreEspeceSlash(requete);
|
- |
|
83 |
// A décommenter lors de l'utilisation des web services eflore
|
- |
|
84 |
//return RetourAutoCompletionService.effectuerPreTraitementChaineRequeteGenreEspeceEflore(requete);
|
- |
|
85 |
}
|
- |
|
86 |
|
- |
|
87 |
@Override
|
- |
|
88 |
protected String[] parserResultatRequete(Response response) {
|
- |
|
89 |
return UtilitairesAutoCompletionService.parserRetourSimple(response);
|
- |
|
90 |
// A décommenter lors de l'utilisation des web services eflore
|
- |
|
91 |
//return RetourAutoCompletionService.parserRetourOss(response);
|
68 |
this.pourRechercheImages = pourRechercheImages;
|
92 |
}
|
69 |
this.pourRechercheObservations = pourRechercheObservations;
|
93 |
};
|
Line 70... |
Line 94... |
70 |
gererEvenements();
|
94 |
gererEvenements();
|
71 |
}
|
95 |
}
|
72 |
|
96 |
|
- |
|
97 |
@Override
|
73 |
@Override
|
98 |
public void go(HasWidgets composite) {
|
74 |
public void go(HasWidgets composite) {
|
99 |
afficherRequeteEtLancerRecherche();
|
Line 75... |
Line 100... |
75 |
afficherRequeteEtLancerRecherche();
|
100 |
autoCompletionNomTaxonsPresenteur.go(vue.getTaxon());
|
76 |
composite.add(vue.asWidget());
|
101 |
composite.add(vue.asWidget());
|