1,5 → 1,8 |
package org.tela_botanica.del.client.composants.moteurrecherche; |
|
import java.util.Iterator; |
import java.util.Map; |
|
import org.tela_botanica.del.client.i18n.I18n; |
import org.tela_botanica.del.client.modeles.InformationsRecherche; |
|
8,10 → 11,12 |
import com.google.gwt.event.dom.client.HasKeyPressHandlers; |
import com.google.gwt.uibinder.client.UiBinder; |
import com.google.gwt.uibinder.client.UiField; |
import com.google.gwt.user.client.DOM; |
import com.google.gwt.user.client.ui.Button; |
import com.google.gwt.user.client.ui.Composite; |
import com.google.gwt.user.client.ui.HasWidgets; |
import com.google.gwt.user.client.ui.Label; |
import com.google.gwt.user.client.ui.ListBox; |
import com.google.gwt.user.client.ui.Panel; |
import com.google.gwt.user.client.ui.TextBox; |
import com.google.gwt.user.client.ui.Widget; |
32,6 → 37,10 |
Button boutonRecherche, boutonRechercheAvancee, boutonFermer, boutonVider; |
@UiField |
TextBox recherchePrincipale, contientMots, departement, famille, genre, motCle, auteur, date; |
@UiField |
ListBox referentiel; |
|
private boolean referentielLectureSeule = false; |
|
public MoteurRechercheVue(String labelRecherche) { |
initWidget(uiBinder.createAndBindUi(this)); |
39,6 → 48,14 |
recherchePrincipale.setText(labelRecherche); |
rechercheAvancee.setVisible(false); |
} |
|
@Override |
public void remplirListeReferentiels(Map<String, String> listeReferentiels) { |
for (Iterator<String> iterator = listeReferentiels.keySet().iterator(); iterator.hasNext();) { |
String codeRef = iterator.next(); |
referentiel.addItem(listeReferentiels.get(codeRef), codeRef); |
} |
} |
|
public String getLabelRecherche() { |
return labelRecherche; |
123,6 → 140,10 |
public String getDate() { |
return date.getText(); |
} |
|
public String getReferentiel() { |
return referentiel.getValue(referentiel.getSelectedIndex()); |
} |
|
public void focusSaisie() { |
this.recherchePrincipale.setFocus(true); |
151,6 → 172,12 |
motCle.setText(informationsRecherche.getMotClef()); |
auteur.setText(informationsRecherche.getAuteur()); |
date.setText(informationsRecherche.getDate()); |
|
for(int i = 0; i < referentiel.getItemCount(); i++) { |
if(referentiel.getValue(i).equals(informationsRecherche.getReferentiel())) { |
referentiel.setSelectedIndex(i); |
} |
} |
|
afficherLigneInfoRecherche(informationsRecherche); |
} |
195,6 → 222,9 |
if (informationRecherche.getDate() != null && !informationRecherche.getDate().equals("")) { |
texteRecherchePrecedente.append(I18n.getVocabulary().date() + ":" + informationRecherche.getDate() + " "); |
} |
if (informationRecherche.getReferentiel() != null && !informationRecherche.getReferentiel().equals("")) { |
texteRecherchePrecedente.append(I18n.getVocabulary().referentiel() + ":" + informationRecherche.getReferentiel() + " "); |
} |
|
recherchePrecedente.setText(texteRecherchePrecedente.toString()); |
} |
237,4 → 267,11 |
public HasWidgets getZoneRss() { |
return zoneRss; |
} |
|
@Override |
public void setReferentielLectureSeule(boolean lectureSeule) { |
referentielLectureSeule = true; |
// la listbox ne possède aucun méthode directe pour être désactivée |
DOM.setElementProperty(referentiel.getElement(), "disabled", "disabled"); |
} |
} |