Subversion Repositories eFlore/Applications.del

Rev

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

Rev 436 Rev 445
Line 64... Line 64...
64
 
64
 
Line 65... Line 65...
65
		public HasText getDate();
65
		public HasText getDate();
Line 66... Line -...
66
 
-
 
67
		public void chargerValeursRecherchePrecedente(InformationsRecherche informationsRecherche);
-
 
68
		
66
 
Line 69... Line 67...
69
		public void chargerValeursRechercheSimplePrecedente(InformationsRecherche informationsRecherche);
67
		public void chargerValeursRecherchePrecedente(InformationsRecherche informationsRecherche);
70
 
68
 
Line 71... Line 69...
71
		public void focusSaisie();
69
		public void focusSaisie();
72
		
70
 
Line 73... Line 71...
73
		public void nettoyer();
71
		public void nettoyer();
Line 74... Line 72...
74
	}
72
	}
75
 
-
 
76
	private final Vue vue;
73
 
77
	private final boolean pourRechercheImages, pourRechercheObservations;
74
	private final Vue vue;
78
 
75
	private final boolean pourRechercheImages, pourRechercheObservations;
Line 79... Line 76...
79
	private AutoCompletionComboBoxPresenteur autoCompletionNomTaxonsPresenteur;
76
 
80
 
-
 
Line 81... Line 77...
81
	public MoteurRecherchePresenteur(Vue vue, boolean pourRechercheImages,
77
	private AutoCompletionComboBoxPresenteur autoCompletionNomTaxonsPresenteur;
82
			boolean pourRechercheObservations) {
-
 
83
		this.vue = vue;
78
 
84
		this.pourRechercheImages = pourRechercheImages;
79
	public MoteurRecherchePresenteur(Vue vue, boolean pourRechercheImages, boolean pourRechercheObservations) {
85
		this.pourRechercheObservations = pourRechercheObservations;
80
		this.vue = vue;
86
 
81
		this.pourRechercheImages = pourRechercheImages;
87
		autoCompletionNomTaxonsPresenteur = new AutoCompletionComboBoxPresenteur(
82
		this.pourRechercheObservations = pourRechercheObservations;
Line 88... Line 83...
88
				UtilitairesAutoCompletionService.urlServiceCompletionNomLocale) {
83
 
89
 
84
		autoCompletionNomTaxonsPresenteur = new AutoCompletionComboBoxPresenteur(UtilitairesAutoCompletionService.urlServiceCompletionNomLocale) {
90
			protected String effectuerPreTraitementChaineRequete(String requete) {
85
 
91
				return UtilitairesAutoCompletionService
-
 
92
						.effectuerPreTraitementChaineRequeteGenreEspeceSlash(requete);
86
			protected String effectuerPreTraitementChaineRequete(String requete) {
93
				// A décommenter lors de l'utilisation des web services eflore
87
				return UtilitairesAutoCompletionService.effectuerPreTraitementChaineRequeteGenreEspeceSlash(requete);
94
				// return
88
				// A décommenter lors de l'utilisation des web services eflore
95
				// RetourAutoCompletionService.effectuerPreTraitementChaineRequeteGenreEspeceEflore(requete);
89
				// return
96
			}
90
				// RetourAutoCompletionService.effectuerPreTraitementChaineRequeteGenreEspeceEflore(requete);
Line 123... Line 117...
123
		});
117
		});
Line 124... Line 118...
124
 
118
 
125
		vue.getBoutonRechercheSimple().addClickHandler(new ClickHandler() {
119
		vue.getBoutonRechercheSimple().addClickHandler(new ClickHandler() {
126
			public void onClick(ClickEvent event) {
120
			public void onClick(ClickEvent event) {
127
				collecterInfosRecherche();
121
				collecterInfosRecherche();
128
				afficherRequeteEtLancerRechercheSimple();
122
				afficherRequeteEtLancerRecherche();
129
			}
123
			}
Line 130... Line 124...
130
		});
124
		});
Line 165... Line 159...
165
		vue.getChampSaisie().addKeyPressHandler(new KeyPressHandler() {
159
		vue.getChampSaisie().addKeyPressHandler(new KeyPressHandler() {
Line 166... Line 160...
166
 
160
 
167
			public void onKeyPress(KeyPressEvent event) {
161
			public void onKeyPress(KeyPressEvent event) {
168
				if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
162
				if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
169
					collecterInfosRecherche();
163
					collecterInfosRecherche();
170
					afficherRequeteEtLancerRechercheSimple();
164
					afficherRequeteEtLancerRecherche();
171
				}
165
				}
172
			}
166
			}
Line 173... Line 167...
173
		});
167
		});
Line 174... Line 168...
174
 
168
 
175
		vue.getChampSaisieCliquable().addClickHandler(new ClickHandler() {
169
		vue.getChampSaisieCliquable().addClickHandler(new ClickHandler() {
176
 
170
 
177
			@Override
-
 
178
			public void onClick(ClickEvent event) {
171
			@Override
179
				if (vue.getValeurRechercheSimple().equals(
172
			public void onClick(ClickEvent event) {
180
						vue.getLabelRecherche())) {
173
				if (vue.getValeurRechercheSimple().equals(vue.getLabelRecherche())) {
181
					vue.setValeurRechercheSimple("");
174
					vue.setValeurRechercheSimple("");
182
				}
175
				}
Line 193... Line 186...
193
		informationRecherche.setGenre(vue.getGenre().getText());
186
		informationRecherche.setGenre(vue.getGenre().getText());
194
		informationRecherche.setTag(vue.getTag().getText());
187
		informationRecherche.setTag(vue.getTag().getText());
195
		informationRecherche.setMotClef(vue.getMotCle().getText());
188
		informationRecherche.setMotClef(vue.getMotCle().getText());
196
		informationRecherche.setAuteur(vue.getAuteur().getText());
189
		informationRecherche.setAuteur(vue.getAuteur().getText());
197
		informationRecherche.setDate(vue.getDate().getText());
190
		informationRecherche.setDate(vue.getDate().getText());
-
 
191
		informationRecherche.setRechercheLibre(vue.getRecherchePrincipale().getText());
Line 198... Line -...
198
		
-
 
199
		if (!vue.getRecherchePrincipale().getText()
-
 
200
				.equals(vue.getLabelRecherche())) {
-
 
201
			informationRecherche.setRechercheLibre(vue.getRecherchePrincipale()
-
 
202
					.getText());
-
 
203
		}
192
 
204
		if (isPourRechercheImages()) {
193
		if (isPourRechercheImages()) {
205
			CacheClient.getInstance().setInformationsRechercheImage(
-
 
206
					informationRecherche);
194
			CacheClient.getInstance().setInformationsRechercheImage(informationRecherche);
207
		} else if (isPourRechercheObservations()) {
195
		} else if (isPourRechercheObservations()) {
208
			CacheClient.getInstance().setInformationsRechercheObservation(
-
 
209
					informationRecherche);
196
			CacheClient.getInstance().setInformationsRechercheObservation(informationRecherche);
210
		}
197
		}
Line 211... Line 198...
211
	}
198
	}
212
 
199
 
213
	private InformationsRecherche getInformationsRechercheEnCache() {
200
	private InformationsRecherche getInformationsRechercheEnCache() {
214
		if (isPourRechercheImages()) {
201
		if (isPourRechercheImages()) {
215
			return CacheClient.getInstance().getInformationsRechercheImage();
-
 
216
		} else if (isPourRechercheObservations()) {
202
			return CacheClient.getInstance().getInformationsRechercheImage();
217
			return CacheClient.getInstance()
203
		} else if (isPourRechercheObservations()) {
218
					.getInformationsRechercheObservation();
204
			return CacheClient.getInstance().getInformationsRechercheObservation();
219
		}
205
		}
Line 220... Line -...
220
		return null;
-
 
221
	}
-
 
222
 
-
 
223
	public void afficherRequeteEtLancerRechercheSimple() {
-
 
224
		InformationsRecherche informationsRecherche = getInformationsRechercheEnCache();
-
 
225
		if (informationsRecherche != null) {
-
 
226
			vue.chargerValeursRechercheSimplePrecedente(informationsRecherche);
-
 
227
		}
-
 
228
		lancerRecherche();
206
		return null;
229
	}
207
	}
230
	
208
 
231
	public void afficherRequeteEtLancerRecherche() {
209
	public void afficherRequeteEtLancerRecherche() {
232
		InformationsRecherche informationsRecherche = getInformationsRechercheEnCache();
210
		InformationsRecherche informationsRecherche = getInformationsRechercheEnCache();