Subversion Repositories eFlore/Applications.del

Rev

Rev 1120 | Rev 1426 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1120 Rev 1367
Line 1... Line 1...
1
package org.tela_botanica.del.client.composants.moteurrecherche;
1
package org.tela_botanica.del.client.composants.moteurrecherche;
Line -... Line 2...
-
 
2
 
-
 
3
import java.util.Iterator;
-
 
4
import java.util.Map;
2
 
5
 
3
import org.tela_botanica.del.client.i18n.I18n;
6
import org.tela_botanica.del.client.i18n.I18n;
Line 4... Line 7...
4
import org.tela_botanica.del.client.modeles.InformationsRecherche;
7
import org.tela_botanica.del.client.modeles.InformationsRecherche;
5
 
8
 
6
import com.google.gwt.core.client.GWT;
9
import com.google.gwt.core.client.GWT;
7
import com.google.gwt.event.dom.client.HasClickHandlers;
10
import com.google.gwt.event.dom.client.HasClickHandlers;
8
import com.google.gwt.event.dom.client.HasKeyPressHandlers;
11
import com.google.gwt.event.dom.client.HasKeyPressHandlers;
-
 
12
import com.google.gwt.uibinder.client.UiBinder;
9
import com.google.gwt.uibinder.client.UiBinder;
13
import com.google.gwt.uibinder.client.UiField;
10
import com.google.gwt.uibinder.client.UiField;
14
import com.google.gwt.user.client.DOM;
11
import com.google.gwt.user.client.ui.Button;
15
import com.google.gwt.user.client.ui.Button;
12
import com.google.gwt.user.client.ui.Composite;
16
import com.google.gwt.user.client.ui.Composite;
-
 
17
import com.google.gwt.user.client.ui.HasWidgets;
13
import com.google.gwt.user.client.ui.HasWidgets;
18
import com.google.gwt.user.client.ui.Label;
14
import com.google.gwt.user.client.ui.Label;
19
import com.google.gwt.user.client.ui.ListBox;
15
import com.google.gwt.user.client.ui.Panel;
20
import com.google.gwt.user.client.ui.Panel;
Line 16... Line 21...
16
import com.google.gwt.user.client.ui.TextBox;
21
import com.google.gwt.user.client.ui.TextBox;
Line 30... Line 35...
30
	Label lienRechercheAvancee, recherchePrecedente;
35
	Label lienRechercheAvancee, recherchePrecedente;
31
	@UiField
36
	@UiField
32
	Button boutonRecherche, boutonRechercheAvancee, boutonFermer, boutonVider;
37
	Button boutonRecherche, boutonRechercheAvancee, boutonFermer, boutonVider;
33
	@UiField
38
	@UiField
34
	TextBox recherchePrincipale, contientMots, departement, famille, genre, motCle, auteur, date;
39
	TextBox recherchePrincipale, contientMots, departement, famille, genre, motCle, auteur, date;
-
 
40
	@UiField
-
 
41
	ListBox referentiel;
-
 
42
	
-
 
43
	private boolean referentielLectureSeule = false;
Line 35... Line 44...
35
 
44
 
36
	public MoteurRechercheVue(String labelRecherche) {
45
	public MoteurRechercheVue(String labelRecherche) {
37
		initWidget(uiBinder.createAndBindUi(this));
46
		initWidget(uiBinder.createAndBindUi(this));
38
		this.labelRecherche = labelRecherche;
47
		this.labelRecherche = labelRecherche;
39
		recherchePrincipale.setText(labelRecherche);
48
		recherchePrincipale.setText(labelRecherche);
40
		rechercheAvancee.setVisible(false);
49
		rechercheAvancee.setVisible(false);
-
 
50
	}
-
 
51
	
-
 
52
	@Override
-
 
53
	public void remplirListeReferentiels(Map<String, String> listeReferentiels) {
-
 
54
		for (Iterator<String> iterator = listeReferentiels.keySet().iterator(); iterator.hasNext();) {
-
 
55
			String codeRef = iterator.next();
-
 
56
			referentiel.addItem(listeReferentiels.get(codeRef), codeRef);
-
 
57
		}
Line 41... Line 58...
41
	}
58
	}
42
 
59
 
43
	public String getLabelRecherche() {
60
	public String getLabelRecherche() {
Line 121... Line 138...
121
	}
138
	}
Line 122... Line 139...
122
 
139
 
123
	public String getDate() {
140
	public String getDate() {
124
		return date.getText();
141
		return date.getText();
-
 
142
	}
-
 
143
	
-
 
144
	public String getReferentiel() {
-
 
145
		return referentiel.getValue(referentiel.getSelectedIndex());
Line 125... Line 146...
125
	}
146
	}
126
 
147
 
127
	public void focusSaisie() {
148
	public void focusSaisie() {
Line 149... Line 170...
149
		famille.setText(informationsRecherche.getFamille());
170
		famille.setText(informationsRecherche.getFamille());
150
		genre.setText(informationsRecherche.getGenre());
171
		genre.setText(informationsRecherche.getGenre());
151
		motCle.setText(informationsRecherche.getMotClef());
172
		motCle.setText(informationsRecherche.getMotClef());
152
		auteur.setText(informationsRecherche.getAuteur());
173
		auteur.setText(informationsRecherche.getAuteur());
153
		date.setText(informationsRecherche.getDate());
174
		date.setText(informationsRecherche.getDate());
-
 
175
		
-
 
176
		for(int i = 0; i < referentiel.getItemCount(); i++) {
-
 
177
			if(referentiel.getValue(i).equals(informationsRecherche.getReferentiel())) {
-
 
178
				referentiel.setSelectedIndex(i);
-
 
179
			}
-
 
180
		}
Line 154... Line 181...
154
 
181
 
155
		afficherLigneInfoRecherche(informationsRecherche);
182
		afficherLigneInfoRecherche(informationsRecherche);
Line 156... Line 183...
156
	}
183
	}
Line 193... Line 220...
193
			texteRecherchePrecedente.append(I18n.getVocabulary().auteur() + ":" + informationRecherche.getAuteur() + " ");
220
			texteRecherchePrecedente.append(I18n.getVocabulary().auteur() + ":" + informationRecherche.getAuteur() + " ");
194
		}
221
		}
195
		if (informationRecherche.getDate() != null && !informationRecherche.getDate().equals("")) {
222
		if (informationRecherche.getDate() != null && !informationRecherche.getDate().equals("")) {
196
			texteRecherchePrecedente.append(I18n.getVocabulary().date() + ":" + informationRecherche.getDate() + " ");
223
			texteRecherchePrecedente.append(I18n.getVocabulary().date() + ":" + informationRecherche.getDate() + " ");
197
		}
224
		}
-
 
225
		if (informationRecherche.getReferentiel() != null && !informationRecherche.getReferentiel().equals("")) {
-
 
226
			texteRecherchePrecedente.append(I18n.getVocabulary().referentiel() + ":" + informationRecherche.getReferentiel() + " ");
-
 
227
		}
Line 198... Line 228...
198
 
228
 
199
		recherchePrecedente.setText(texteRecherchePrecedente.toString());
229
		recherchePrecedente.setText(texteRecherchePrecedente.toString());
Line 200... Line 230...
200
	}
230
	}
Line 235... Line 265...
235
	}
265
	}
Line 236... Line 266...
236
	
266
	
237
	public HasWidgets getZoneRss() {
267
	public HasWidgets getZoneRss() {
238
		return zoneRss;
268
		return zoneRss;
-
 
269
	}
-
 
270
 
-
 
271
	@Override
-
 
272
	public void setReferentielLectureSeule(boolean lectureSeule) {
-
 
273
		referentielLectureSeule = true;
-
 
274
		// la listbox ne possède aucun méthode directe pour être désactivée 
-
 
275
		DOM.setElementProperty(referentiel.getElement(), "disabled", "disabled");
239
	}
276
	}
240
}
277
}