Subversion Repositories eFlore/Applications.del

Compare Revisions

Ignore whitespace Rev 418 → Rev 419

/trunk/src/org/tela_botanica/del/client/composants/moteurrecherche/MoteurRechercheVue.java
26,11 → 26,11
private String labelRecherche = "";
 
@UiField
Panel rechercheAvancee,taxon;
Panel rechercheAvancee, taxon;
@UiField
Label lienRechercheAvancee, recherchePrecedente;
@UiField
Button boutonRecherche, boutonRechercheAvancee, boutonFermer;
Button boutonRecherche, boutonRechercheAvancee, boutonFermer, boutonVider;
@UiField
TextBox recherchePrincipale, departement, commune, famille, genre, tag, motCle, auteur, date;
 
53,6 → 53,8
@Override
public void basculerAffichageZoneCache() {
rechercheAvancee.setVisible(!rechercheAvancee.isVisible());
recherchePrincipale.setVisible(!recherchePrincipale.isVisible());
boutonRecherche.setVisible(!boutonRecherche.isVisible());
}
 
@Override
64,6 → 66,11
public HasClickHandlers getBoutonFermer() {
return boutonFermer;
}
@Override
public HasClickHandlers getBoutonVider() {
return boutonVider;
}
 
@Override
public HasClickHandlers getBoutonRechercheAvancee() {
90,19 → 97,27
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) {
getAuteur().setText(informationsRecherche.getAuteur());
informationsRecherche.setRechercheLibre(null);
getRecherchePrincipale().setText("");
getDepartement().setText(informationsRecherche.getDepartement());
getCommune().setText(informationsRecherche.getCommune());
getDate().setText(informationsRecherche.getDate());
getDepartement().setText(informationsRecherche.getDepartement());
getFamille().setText(informationsRecherche.getFamille());
getGenre().setText(informationsRecherche.getGenre());
getTag().setText(informationsRecherche.getTag());
getMotCle().setText(informationsRecherche.getMotClef());
 
getAuteur().setText(informationsRecherche.getAuteur());
getDate().setText(informationsRecherche.getDate());
if (informationsRecherche.getRechercheLibre() != null && !informationsRecherche.getRechercheLibre().equals("")) {
getRecherchePrincipale().setText(informationsRecherche.getRechercheLibre());
}
 
afficherLigneInfoRecherche(informationsRecherche);
}
 
114,34 → 129,49
*/
private void afficherLigneInfoRecherche(InformationsRecherche informationRecherche) {
 
//tax dep com fam gen ta mo au date
StringBuffer texteRecherchePrecedente = new StringBuffer();
if (informationRecherche.getRechercheLibre()!=null&&!informationRecherche.getRechercheLibre().equals("")) {
texteRecherchePrecedente.append(I18n.getVocabulary().rechercheLibre() + ":" + informationRecherche.getRechercheLibre() + " ");
}
if (!informationRecherche.getAuteur().equals("")) {
texteRecherchePrecedente.append(I18n.getVocabulary().auteur() + ":" + informationRecherche.getAuteur() + " ");
if (informationRecherche.getTaxon() != null&&!informationRecherche.getTaxon().equals("")) {
texteRecherchePrecedente.append(I18n.getVocabulary().taxon() + ":" + informationRecherche.getTaxon() + " ");
}
if (!informationRecherche.getCommune().equals("")) {
if (informationRecherche.getDepartement()!=null && !informationRecherche.getDepartement().equals("")) {
texteRecherchePrecedente.append(I18n.getVocabulary().departement() + ":" + informationRecherche.getDepartement() + " ");
}
if (informationRecherche.getCommune()!=null && !informationRecherche.getCommune().equals("")) {
texteRecherchePrecedente.append(I18n.getVocabulary().commune() + ":" + informationRecherche.getCommune() + " ");
}
if (!informationRecherche.getDate().equals("")) {
texteRecherchePrecedente.append(I18n.getVocabulary().date() + ":" + informationRecherche.getDate() + " ");
}
if (!informationRecherche.getDepartement().equals("")) {
texteRecherchePrecedente.append(I18n.getVocabulary().departement() + ":" + informationRecherche.getDepartement() + " ");
}
if (!informationRecherche.getFamille().equals("")) {
if (informationRecherche.getFamille()!=null && !informationRecherche.getFamille().equals("")) {
texteRecherchePrecedente.append(I18n.getVocabulary().famille() + ":" + informationRecherche.getFamille() + " ");
}
if (!informationRecherche.getGenre().equals("")) {
if (informationRecherche.getGenre()!=null && !informationRecherche.getGenre().equals("")) {
texteRecherchePrecedente.append(I18n.getVocabulary().genre() + ":" + informationRecherche.getGenre() + " ");
}
if (!informationRecherche.getMotClef().equals("")) {
if (informationRecherche.getTag()!=null && !informationRecherche.getTag().equals("")) {
texteRecherchePrecedente.append(I18n.getVocabulary().tag() + ":" + informationRecherche.getTag() + " ");
}
if (informationRecherche.getMotClef()!=null && !informationRecherche.getMotClef().equals("")) {
texteRecherchePrecedente.append(I18n.getVocabulary().mot_clef() + ":" + informationRecherche.getMotClef() + " ");
}
if (informationRecherche.getAuteur()!=null && !informationRecherche.getAuteur().equals("")) {
texteRecherchePrecedente.append(I18n.getVocabulary().auteur() + ":" + informationRecherche.getAuteur() + " ");
}
if (informationRecherche.getDate()!=null && !informationRecherche.getDate().equals("")) {
texteRecherchePrecedente.append(I18n.getVocabulary().date() + ":" + informationRecherche.getDate() + " ");
}
recherchePrecedente.setText(texteRecherchePrecedente.toString());
}
 
public void nettoyer() {
chargerValeursRecherchePrecedente(new InformationsRecherche());
}
public HasText getRecherchePrincipale() {
return recherchePrincipale;
}