65,11 → 65,9 |
public HasText getDate(); |
|
public void chargerValeursRecherchePrecedente(InformationsRecherche informationsRecherche); |
|
public void chargerValeursRechercheSimplePrecedente(InformationsRecherche informationsRecherche); |
|
public void focusSaisie(); |
|
|
public void nettoyer(); |
} |
|
78,18 → 76,15 |
|
private AutoCompletionComboBoxPresenteur autoCompletionNomTaxonsPresenteur; |
|
public MoteurRecherchePresenteur(Vue vue, boolean pourRechercheImages, |
boolean pourRechercheObservations) { |
public MoteurRecherchePresenteur(Vue vue, boolean pourRechercheImages, boolean pourRechercheObservations) { |
this.vue = vue; |
this.pourRechercheImages = pourRechercheImages; |
this.pourRechercheObservations = pourRechercheObservations; |
|
autoCompletionNomTaxonsPresenteur = new AutoCompletionComboBoxPresenteur( |
UtilitairesAutoCompletionService.urlServiceCompletionNomLocale) { |
autoCompletionNomTaxonsPresenteur = new AutoCompletionComboBoxPresenteur(UtilitairesAutoCompletionService.urlServiceCompletionNomLocale) { |
|
protected String effectuerPreTraitementChaineRequete(String requete) { |
return UtilitairesAutoCompletionService |
.effectuerPreTraitementChaineRequeteGenreEspeceSlash(requete); |
return UtilitairesAutoCompletionService.effectuerPreTraitementChaineRequeteGenreEspeceSlash(requete); |
// A décommenter lors de l'utilisation des web services eflore |
// return |
// RetourAutoCompletionService.effectuerPreTraitementChaineRequeteGenreEspeceEflore(requete); |
97,8 → 92,7 |
|
@Override |
protected String[] parserResultatRequete(Response response) { |
return UtilitairesAutoCompletionService |
.parserRetourSimple(response); |
return UtilitairesAutoCompletionService.parserRetourSimple(response); |
// A décommenter lors de l'utilisation des web services eflore |
// return RetourAutoCompletionService.parserRetourOss(response); |
} |
125,7 → 119,7 |
vue.getBoutonRechercheSimple().addClickHandler(new ClickHandler() { |
public void onClick(ClickEvent event) { |
collecterInfosRecherche(); |
afficherRequeteEtLancerRechercheSimple(); |
afficherRequeteEtLancerRecherche(); |
} |
}); |
|
141,10 → 135,10 |
|
@Override |
public void onClick(ClickEvent event) { |
|
|
autoCompletionNomTaxonsPresenteur.nettoyer(); |
vue.nettoyer(); |
|
|
InformationsRecherche infosRecherche = new InformationsRecherche(); |
if (isPourRechercheImages()) { |
CacheClient.getInstance().setInformationsRechercheImage(infosRecherche); |
167,7 → 161,7 |
public void onKeyPress(KeyPressEvent event) { |
if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) { |
collecterInfosRecherche(); |
afficherRequeteEtLancerRechercheSimple(); |
afficherRequeteEtLancerRecherche(); |
} |
} |
}); |
176,8 → 170,7 |
|
@Override |
public void onClick(ClickEvent event) { |
if (vue.getValeurRechercheSimple().equals( |
vue.getLabelRecherche())) { |
if (vue.getValeurRechercheSimple().equals(vue.getLabelRecherche())) { |
vue.setValeurRechercheSimple(""); |
} |
} |
195,18 → 188,12 |
informationRecherche.setMotClef(vue.getMotCle().getText()); |
informationRecherche.setAuteur(vue.getAuteur().getText()); |
informationRecherche.setDate(vue.getDate().getText()); |
|
if (!vue.getRecherchePrincipale().getText() |
.equals(vue.getLabelRecherche())) { |
informationRecherche.setRechercheLibre(vue.getRecherchePrincipale() |
.getText()); |
} |
informationRecherche.setRechercheLibre(vue.getRecherchePrincipale().getText()); |
|
if (isPourRechercheImages()) { |
CacheClient.getInstance().setInformationsRechercheImage( |
informationRecherche); |
CacheClient.getInstance().setInformationsRechercheImage(informationRecherche); |
} else if (isPourRechercheObservations()) { |
CacheClient.getInstance().setInformationsRechercheObservation( |
informationRecherche); |
CacheClient.getInstance().setInformationsRechercheObservation(informationRecherche); |
} |
} |
|
214,20 → 201,11 |
if (isPourRechercheImages()) { |
return CacheClient.getInstance().getInformationsRechercheImage(); |
} else if (isPourRechercheObservations()) { |
return CacheClient.getInstance() |
.getInformationsRechercheObservation(); |
return CacheClient.getInstance().getInformationsRechercheObservation(); |
} |
return null; |
} |
|
public void afficherRequeteEtLancerRechercheSimple() { |
InformationsRecherche informationsRecherche = getInformationsRechercheEnCache(); |
if (informationsRecherche != null) { |
vue.chargerValeursRechercheSimplePrecedente(informationsRecherche); |
} |
lancerRecherche(); |
} |
|
public void afficherRequeteEtLancerRecherche() { |
InformationsRecherche informationsRecherche = getInformationsRechercheEnCache(); |
if (informationsRecherche != null) { |
237,7 → 215,7 |
lancerRecherche(); |
} |
|
public abstract void lancerRecherche(); |
public abstract void lancerRecherche(); |
|
public boolean isPourRechercheImages() { |
return pourRechercheImages; |