Subversion Repositories eFlore/Applications.del

Compare Revisions

Ignore whitespace Rev 444 → Rev 445

/trunk/src/org/tela_botanica/del/client/composants/moteurrecherche/MoteurRecherchePresenteur.java
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;
/trunk/src/org/tela_botanica/del/client/composants/moteurrecherche/MoteurRechercheVue.java
61,12 → 61,12
public HasClickHandlers getBoutonRechercheSimple() {
return boutonRecherche;
}
 
@Override
public HasClickHandlers getBoutonFermer() {
return boutonFermer;
}
 
@Override
public HasClickHandlers getBoutonVider() {
return boutonVider;
97,18 → 97,8
recherchePrincipale.setText(valeurRecherche);
}
 
public void chargerValeursRechercheSimplePrecedente(InformationsRecherche informationsRecherche) {
 
this.nettoyer();
if (informationsRecherche.getRechercheLibre() != null && !informationsRecherche.getRechercheLibre().equals("")) {
getRecherchePrincipale().setText(informationsRecherche.getRechercheLibre());
}
afficherLigneInfoRecherche(informationsRecherche);
}
 
public void chargerValeursRecherchePrecedente(InformationsRecherche informationsRecherche) {
informationsRecherche.setRechercheLibre(null);
getRecherchePrincipale().setText("");
getRecherchePrincipale().setText(informationsRecherche.getRechercheLibre());
getDepartement().setText(informationsRecherche.getDepartement());
getCommune().setText(informationsRecherche.getCommune());
getFamille().setText(informationsRecherche.getFamille());
117,7 → 107,7
getMotCle().setText(informationsRecherche.getMotClef());
getAuteur().setText(informationsRecherche.getAuteur());
getDate().setText(informationsRecherche.getDate());
 
afficherLigneInfoRecherche(informationsRecherche);
}
 
129,42 → 119,40
*/
private void afficherLigneInfoRecherche(InformationsRecherche informationRecherche) {
 
//tax dep com fam gen ta mo au date
// tax dep com fam gen ta mo au date
StringBuffer texteRecherchePrecedente = new StringBuffer();
if (informationRecherche.getRechercheLibre()!=null&&!informationRecherche.getRechercheLibre().equals("")) {
 
if (informationRecherche.getRechercheLibre() != null && !informationRecherche.getRechercheLibre().equals("")) {
texteRecherchePrecedente.append(I18n.getVocabulary().rechercheLibre() + ":" + informationRecherche.getRechercheLibre() + " ");
}
if (informationRecherche.getTaxon() != null&&!informationRecherche.getTaxon().equals("")) {
if (informationRecherche.getTaxon() != null && !informationRecherche.getTaxon().equals("")) {
texteRecherchePrecedente.append(I18n.getVocabulary().taxon() + ":" + informationRecherche.getTaxon() + " ");
}
if (informationRecherche.getDepartement()!=null && !informationRecherche.getDepartement().equals("")) {
if (informationRecherche.getDepartement() != null && !informationRecherche.getDepartement().equals("")) {
texteRecherchePrecedente.append(I18n.getVocabulary().departement() + ":" + informationRecherche.getDepartement() + " ");
}
if (informationRecherche.getCommune()!=null && !informationRecherche.getCommune().equals("")) {
if (informationRecherche.getCommune() != null && !informationRecherche.getCommune().equals("")) {
texteRecherchePrecedente.append(I18n.getVocabulary().commune() + ":" + informationRecherche.getCommune() + " ");
}
if (informationRecherche.getFamille()!=null && !informationRecherche.getFamille().equals("")) {
if (informationRecherche.getFamille() != null && !informationRecherche.getFamille().equals("")) {
texteRecherchePrecedente.append(I18n.getVocabulary().famille() + ":" + informationRecherche.getFamille() + " ");
}
if (informationRecherche.getGenre()!=null && !informationRecherche.getGenre().equals("")) {
if (informationRecherche.getGenre() != null && !informationRecherche.getGenre().equals("")) {
texteRecherchePrecedente.append(I18n.getVocabulary().genre() + ":" + informationRecherche.getGenre() + " ");
}
if (informationRecherche.getTag()!=null && !informationRecherche.getTag().equals("")) {
if (informationRecherche.getTag() != null && !informationRecherche.getTag().equals("")) {
texteRecherchePrecedente.append(I18n.getVocabulary().tag() + ":" + informationRecherche.getTag() + " ");
}
if (informationRecherche.getMotClef()!=null && !informationRecherche.getMotClef().equals("")) {
if (informationRecherche.getMotClef() != null && !informationRecherche.getMotClef().equals("")) {
texteRecherchePrecedente.append(I18n.getVocabulary().mot_clef() + ":" + informationRecherche.getMotClef() + " ");
}
if (informationRecherche.getAuteur()!=null && !informationRecherche.getAuteur().equals("")) {
if (informationRecherche.getAuteur() != null && !informationRecherche.getAuteur().equals("")) {
texteRecherchePrecedente.append(I18n.getVocabulary().auteur() + ":" + informationRecherche.getAuteur() + " ");
}
if (informationRecherche.getDate()!=null && !informationRecherche.getDate().equals("")) {
if (informationRecherche.getDate() != null && !informationRecherche.getDate().equals("")) {
texteRecherchePrecedente.append(I18n.getVocabulary().date() + ":" + informationRecherche.getDate() + " ");
}
 
recherchePrecedente.setText(texteRecherchePrecedente.toString());
}
 
171,7 → 159,7
public void nettoyer() {
chargerValeursRecherchePrecedente(new InformationsRecherche());
}
 
public HasText getRecherchePrincipale() {
return recherchePrincipale;
}