Subversion Repositories eFlore/Applications.del

Rev

Rev 1792 | Rev 1995 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1792 Rev 1986
Line 27... Line 27...
27
	}
27
	}
Line 28... Line 28...
28
 
28
 
29
	private static Binder uiBinder = GWT.create(Binder.class);
29
	private static Binder uiBinder = GWT.create(Binder.class);
Line -... Line 30...
-
 
30
	private String labelRecherche = "";
-
 
31
	
-
 
32
	private Map<String,String> listePays;
-
 
33
	
-
 
34
	private InformationsRecherche informationRecherche;
-
 
35
	
-
 
36
	// Si l'on charge une recherche précédente et que la liste des pays n'est 
-
 
37
	// pas encore arrivée, on stocke le pays pour l'afficher quand la liste arrive
30
	private String labelRecherche = "";
38
	private String paysEnAttente;
31
 
39
 
32
	@UiField
40
	@UiField
33
	Panel rechercheAvancee, taxon, commune, zoneRss, conteneurMotCle, conteneurMotCleCel, conteneurMotCleDel  ;
41
	Panel rechercheAvancee, taxon, commune, zoneRss, conteneurMotCle, conteneurMotCleCel, conteneurMotCleDel  ;
34
	@UiField
42
	@UiField
35
	Label lienRechercheAvancee, recherchePrecedente;
43
	Label lienRechercheAvancee, recherchePrecedente;
36
	@UiField
44
	@UiField
37
	Button boutonRecherche, boutonRechercheAvancee, boutonFermer, boutonVider;
45
	Button boutonRecherche, boutonRechercheAvancee, boutonFermer, boutonVider;
38
	@UiField
46
	@UiField
39
	TextBox recherchePrincipale, contientMots, departement, famille, genre, motCle, motCleCel, motCleDel, auteur, date;
47
	TextBox recherchePrincipale, contientMots, departement, famille, genre, motCle, motCleCel, motCleDel, auteur, date;
Line 40... Line 48...
40
	@UiField
48
	@UiField
41
	ListBox referentiel;
49
	ListBox referentiel, pays;
42
 
50
 
43
	public MoteurRechercheVue(String labelRecherche) {
51
	public MoteurRechercheVue(String labelRecherche) {
Line 54... Line 62...
54
			referentiel.addItem(listeReferentiels.get(codeRef), codeRef);
62
			referentiel.addItem(listeReferentiels.get(codeRef), codeRef);
55
		}
63
		}
56
		referentiel.setItemSelected(1, true);
64
		referentiel.setItemSelected(1, true);
57
	}
65
	}
Line -... Line 66...
-
 
66
	
-
 
67
	@Override
-
 
68
	public void remplirListePays(Map<String, String> listePays) {
-
 
69
		this.listePays = listePays;
-
 
70
		pays.clear();
-
 
71
		// Pour pouvoir annuler la selection de pays, on ajoute un item vide
-
 
72
		pays.addItem("", "");
-
 
73
		int index = 1;
-
 
74
		for (Iterator<String> iterator = listePays.keySet().iterator(); iterator.hasNext();) {
-
 
75
			String codePays = iterator.next();
-
 
76
			pays.addItem(listePays.get(codePays), codePays);
-
 
77
			
-
 
78
			if(paysEnAttente != null && codePays.equals(paysEnAttente)) {
-
 
79
				pays.setItemSelected(index, true);
-
 
80
			}
-
 
81
			index++;
-
 
82
		}
-
 
83
		
-
 
84
		if(paysEnAttente != null) {
-
 
85
			afficherLigneInfoRecherche(informationRecherche);
-
 
86
		}
-
 
87
		paysEnAttente = null;
-
 
88
	}
58
 
89
 
59
	public String getLabelRecherche() {
90
	public String getLabelRecherche() {
60
		return labelRecherche;
91
		return labelRecherche;
Line 61... Line 92...
61
	}
92
	}
Line 102... Line 133...
102
 
133
 
103
	public void setContientMots(String mots) {
134
	public void setContientMots(String mots) {
104
		contientMots.setText(mots);
135
		contientMots.setText(mots);
Line -... Line 136...
-
 
136
	}
-
 
137
	
-
 
138
	public String getPays() {
-
 
139
		return pays.getValue(pays.getSelectedIndex());
105
	}
140
	}
106
 
141
 
107
	public String getDepartement() {
142
	public String getDepartement() {
Line 108... Line 143...
108
		return departement.getText();
143
		return departement.getText();
Line 178... Line 213...
178
			if(referentiel.getValue(i).equals(informationsRecherche.getReferentiel())) {
213
			if(referentiel.getValue(i).equals(informationsRecherche.getReferentiel())) {
179
				referentiel.setSelectedIndex(i);
214
				referentiel.setSelectedIndex(i);
180
			}
215
			}
181
		}
216
		}
Line -... Line 217...
-
 
217
		
-
 
218
		// la liste des pays du champs de recherche est asynchrone 
-
 
219
		// donc elle peut ne pas avoir encore été chargée
-
 
220
		if(listePays != null) {
-
 
221
			for(int i = 0; i < pays.getItemCount(); i++) {
-
 
222
				if(pays.getValue(i).equals(paysEnAttente)) {
-
 
223
					pays.setSelectedIndex(i);
-
 
224
				}
-
 
225
			}
-
 
226
		} else {
-
 
227
			paysEnAttente = informationsRecherche.getPays();
-
 
228
		}
182
 
229
 
183
		afficherLigneInfoRecherche(informationsRecherche);
230
		afficherLigneInfoRecherche(informationsRecherche);
Line 184... Line 231...
184
	}
231
	}
185
 
232
 
186
	/**
233
	/**
187
	 * Affiche la ligne d'en tête montrant les elements de la requête à
234
	 * Affiche la ligne d'en tête montrant les elements de la requête à
188
	 * l'utilisateur
235
	 * l'utilisateur
189
	 * 
236
	 * 
190
	 * @param informationRecherche
237
	 * @param informationRecherche
-
 
238
	 */
-
 
239
	private void afficherLigneInfoRecherche(InformationsRecherche informationRecherche) {
-
 
240
		
191
	 */
241
		this.informationRecherche = informationRecherche; 
192
	private void afficherLigneInfoRecherche(InformationsRecherche informationRecherche) {
242
		
Line 193... Line 243...
193
		// tax dep com fam gen ta mo au date
243
		// tax dep com fam gen ta mo au date
194
		StringBuffer texteRecherchePrecedente = new StringBuffer();
244
		StringBuffer texteRecherchePrecedente = new StringBuffer();
Line 200... Line 250...
200
			texteRecherchePrecedente.append(I18n.getVocabulary().taxon() + ":" + informationRecherche.getTaxon() + " ");
250
			texteRecherchePrecedente.append(I18n.getVocabulary().taxon() + ":" + informationRecherche.getTaxon() + " ");
201
		}
251
		}
202
		if (informationRecherche.getDepartement() != null && !informationRecherche.getDepartement().equals("")) {
252
		if (informationRecherche.getDepartement() != null && !informationRecherche.getDepartement().equals("")) {
203
			texteRecherchePrecedente.append(I18n.getVocabulary().departement() + ":" + informationRecherche.getDepartement() + " ");
253
			texteRecherchePrecedente.append(I18n.getVocabulary().departement() + ":" + informationRecherche.getDepartement() + " ");
204
		}
254
		}
-
 
255
		if (listePays != null && informationRecherche.getPays() != null && !informationRecherche.getPays().equals("")) {
-
 
256
			texteRecherchePrecedente.append(I18n.getVocabulary().pays() + ":" + listePays.get(informationRecherche.getPays()) + " ");
-
 
257
		}
205
		if (informationRecherche.getCommune() != null && !informationRecherche.getCommune().equals("")) {
258
		if (informationRecherche.getCommune() != null && !informationRecherche.getCommune().equals("")) {
206
			texteRecherchePrecedente.append(I18n.getVocabulary().commune() + ":" + informationRecherche.getCommune() + " ");
259
			texteRecherchePrecedente.append(I18n.getVocabulary().commune() + ":" + informationRecherche.getCommune() + " ");
207
		}
260
		}
208
		if (informationRecherche.getFamille() != null && !informationRecherche.getFamille().equals("")) {
261
		if (informationRecherche.getFamille() != null && !informationRecherche.getFamille().equals("")) {
209
			texteRecherchePrecedente.append(I18n.getVocabulary().famille() + ":" + informationRecherche.getFamille() + " ");
262
			texteRecherchePrecedente.append(I18n.getVocabulary().famille() + ":" + informationRecherche.getFamille() + " ");