Subversion Repositories eFlore/Archives.cel-v1

Rev

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

Rev 4 Rev 5
Line 35... Line 35...
35
import com.google.gwt.user.client.ui.CheckBox;
35
import com.google.gwt.user.client.ui.CheckBox;
36
import com.google.gwt.user.client.ui.Widget;
36
import com.google.gwt.user.client.ui.Widget;
37
import com.google.gwt.user.client.ui.ClickListener;
37
import com.google.gwt.user.client.ui.ClickListener;
38
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
38
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
39
import com.google.gwt.user.client.ui.HasVerticalAlignment;
39
import com.google.gwt.user.client.ui.HasVerticalAlignment;
40
import com.google.gwt.user.client.ui.HTMLTable.CellFormatter;
-
 
Line 41... Line 40...
41
 
40
 
Line 42... Line 41...
42
import java.util.Vector;
41
import java.util.Vector;
Line 43... Line -...
43
 
-
 
44
 
-
 
45
/* Le retour de getUser appelle getCount qui appelle update pour veiller à une initialisation correcte
42
 
-
 
43
 
46
 
44
/* Le retour de getUser appelle getCount qui appelle update pour veiller à une initialisation correcte
Line -... Line 45...
-
 
45
 
-
 
46
 */
-
 
47
 
47
/**
48
public class TaxonList extends Composite implements AutoCompleteAsyncTextBoxListener  {
Line 48... Line 49...
48
 * A composite that displays a list of emails that can be selected.
49
 
49
 */
50
 
50
public class TaxonList extends Composite implements AutoCompleteAsyncTextBoxListener  {
51
	
Line 76... Line 77...
76
	      bar.setVerticalAlignment(DockPanel.ALIGN_MIDDLE);
77
	      bar.setVerticalAlignment(DockPanel.ALIGN_MIDDLE);
77
	      bar.setCellHorizontalAlignment(status, HasHorizontalAlignment.ALIGN_RIGHT);
78
	      bar.setCellHorizontalAlignment(status, HasHorizontalAlignment.ALIGN_RIGHT);
78
	      bar.setCellVerticalAlignment(status, HasVerticalAlignment.ALIGN_MIDDLE);
79
	      bar.setCellVerticalAlignment(status, HasVerticalAlignment.ALIGN_MIDDLE);
79
	      bar.setCellWidth(status, "100%");
80
	      bar.setCellWidth(status, "100%");
Line 80... Line -...
80
 
-
 
81
	      // Initialize prev & first button to disabled.
-
 
82
	      //
81
 
Line 83... Line 82...
83
	    }
82
	    }
84
 
83
 
Line 97... Line 96...
97
	  	      if (startIndex < 0)
96
	  	      if (startIndex < 0)
98
	  	        startIndex = 0;
97
	  	        startIndex = 0;
99
	  	      }
98
	  	      }
100
	  	     else {
99
	  	     else {
101
	  	    	 if (sender==gotoEnd) {
100
	  	    	 if (sender==gotoEnd) {
102
	  	    	  	if ((count%VISIBLE_TAXON_COUNT)>0) {
-
 
103
    		    		startIndex=count-(count%VISIBLE_TAXON_COUNT); 
-
 
104
    		    	}
-
 
105
    		    	else {
101
	  	    		gotoEnd();
106
    		    		startIndex=count-VISIBLE_TAXON_COUNT; 
-
 
107
    		    	}
-
 
108
	  	    	 }
102
	  	    	 }
109
	  	    	 else {
103
	  	    	 else {
110
	  	    		 if (sender== gotoFirst) {
104
	  	    		 if (sender== gotoFirst) {
111
	  	    			 startIndex = 0;
105
	  	    			 startIndex = 0;
112
	  	    		 }
106
	  	    		 }
Line 116... Line 110...
116
	  	   update();
110
	  	   update();
117
	    }
111
	    }
Line 118... Line 112...
118
 
112
 
Line 119... Line 113...
119
	  }
113
	  }
120
 
114
 
121
  public void setStatusText(String text) {
115
  private void setStatusText(String text) {
Line 122... Line -...
122
	    navBar.status.setText(text);
-
 
123
  }
-
 
124
 
-
 
125
  public void clearStatusText() {
-
 
126
	    navBar.status.setHTML("&nbsp;");
-
 
Line 127... Line 116...
127
  }
116
	    navBar.status.setText(text);
Line 128... Line 117...
128
 
117
  }
129
	
118
 
Line 147... Line 136...
147
  private NavBar navBar = new NavBar();
136
  private NavBar navBar = new NavBar();
Line 148... Line 137...
148
  
137
  
Line 149... Line 138...
149
  public TaxonList(Vector comps) {
138
  public TaxonList(Vector comps) {
150
 
-
 
Line 151... Line 139...
151
	 
139
 
Line 152... Line 140...
152
	getUser();
140
	 
Line 153... Line 141...
153
 
141
     initAsync();
Line 154... Line 142...
154
	
142
	
155
	// Information complementaire
143
	// Information complementaire : un tableau associe au retour de l'assistant de saisie
156
	
144
	
Line 167... Line 155...
167
    header.setText(0, 0, "");
155
    header.setText(0, 0, "");
168
    header.setText(0, 1, "Nom saisi");
156
    header.setText(0, 1, "Nom saisi");
169
    header.setText(0, 2, "Nom retenu");
157
    header.setText(0, 2, "Nom retenu");
170
    header.setHTML(0, 3, "Code<br>Nomenclatural");
158
    header.setHTML(0, 3, "Code<br>Nomenclatural");
171
    header.setHTML(0, 4, "Code<br>Taxonomique");
159
    header.setHTML(0, 4, "Code<br>Taxonomique");
172
    header.setText(0, 5, "");
160
    header.setText(0, 5, "Famille");
Line 173... Line 161...
173
  
161
  
174
	header.getCellFormatter().setWidth(0,0,"2%");
162
	header.getCellFormatter().setWidth(0,0,"2%");
175
	header.getCellFormatter().setWidth(0,1,"31%");
163
	header.getCellFormatter().setWidth(0,1,"31%");
176
	header.getCellFormatter().setWidth(0,2,"31%");
164
	header.getCellFormatter().setWidth(0,2,"31%");
177
	header.getCellFormatter().setWidth(0,3,"9%");
165
	header.getCellFormatter().setWidth(0,3,"9%");
178
	header.getCellFormatter().setWidth(0,4,"9%");
166
	header.getCellFormatter().setWidth(0,4,"9%");
Line 179... Line -...
179
	header.getCellFormatter().setWidth(0,5,"18%");
-
 
180
 
-
 
181
	
-
 
182
 
-
 
183
    header.setCellSpacing(0);
-
 
184
    header.setCellPadding(2);
167
	header.getCellFormatter().setWidth(0,5,"18%");
Line 185... Line 168...
185
 
168
 
186
    // Setup the table.
169
    // Mise en forme de la table.
187
	  
170
	  
188
    table.setCellSpacing(0);
171
    table.setCellSpacing(0);
Line -... Line 172...
-
 
172
    table.setBorderWidth(0);
189
    table.setBorderWidth(0);
173
    table.setCellPadding(2);
190
    table.setCellPadding(2);
174
    table.setWidth("100%");
Line 191... Line -...
191
    table.setWidth("100%");
-
 
Line 192... Line 175...
192
 
175
 
Line 193... Line 176...
193
 
176
    // Mise en forme barre navigation
194
    navBar.setWidth("100%");
177
    
Line 203... Line 186...
203
    
186
    
Line 204... Line 187...
204
    initWidget(panel);
187
    initWidget(panel);
205
    
188
    
-
 
189
 
-
 
190
  }
-
 
191
 
-
 
192
  /**
-
 
193
   * Action lancee par la selection d'un nom dans l'assistant de saisie. Lance la recherche d'informations
206
 
194
   * complémentaires (famille, numero nomenclaturaux etc) et met a jour l'inventaire (addelement())
207
  }
195
   * @return void
-
 
196
   */
-
 
197
  public void onValidate(SourcesAutoCompleteAsyncTextBoxEvents sender,int pos, String str) {
-
 
198
	
-
 
199
	  	setStatusDisabled();
-
 
200
	  	
-
 
201
	    // Il y a surement une meilleure facon de faire que de passer par une variable de classe 
-
 
202
	    // pour atteindre une inner classe
-
 
203
	  
Line 208... Line -...
208
 
-
 
209
  public void onValidate(SourcesAutoCompleteAsyncTextBoxEvents sender,int pos, String str) {
-
 
210
		
-
 
211
	  
204
	    element=str;
-
 
205
	
-
 
206
	    // Saisie assistée
-
 
207
	  
212
// Recherche informations complementaires :
208
	    if (pos>=0) {
213
// et Ajout ligne 
-
 
Line 214... Line 209...
214
	 
209
	 
215
	    if (pos>=0) {
210
	    // Le vecteur complements contient les informations complémentaires associées à un nom.
Line 216... Line 211...
216
	    complement=(String) complements.get(pos);
211
	    	
Line 234... Line 229...
234
				  			}
229
				  			}
235
				    	} 
230
				    	} 
Line 236... Line 231...
236
 
231
 
237
				   	});
232
				   	});
-
 
233
	    }
238
	    }
234
	    // Saisie libre
239
	    else {
235
	    else {
Line 240... Line 236...
240
 			complements.clear();
236
 			complements.clear();
241
 
237
 
242
			addElement(str," "," "," "," "," ");
238
			addElement(element," "," "," "," "," ");
243
	    }
239
	    }
-
 
240
  }
-
 
241
 
-
 
242
  /**
-
 
243
   * Ajoute un element à l'inventaire 
-
 
244
   * @param nom_sel : nom selectionne
-
 
245
   * @param num_nom_sel : numero nomenclatural nom selectionne
-
 
246
   * @param nom_ret : nom retenu
-
 
247
   * @param num_nom_ret : numero nomenclaturel nom retenu
-
 
248
   * @param num_taxon : numero taxonomique
Line 244... Line 249...
244
  }
249
   * @param famille : famille
Line -... Line 250...
-
 
250
   */
-
 
251
 
245
  
252
  public void addElement(String nom_sel, String num_nom_sel, String nom_ret, String num_nom_ret, String num_taxon, String famille) {
246
 
253
	 
247
  public void addElement(String nom_sel, String num_nom_sel, String nom_ret, String num_nom_ret, String num_taxon, String famille) {
254
	  // Calcul du nouveau numéro d'ordre 
248
	 
255
	  
Line 249... Line 256...
249
	  int lastOrdre=1;
256
	 /* int order=1;
250
	  if (table.getRowCount()>0) {
257
	  if (table.getRowCount()>0) {
251
		  lastOrdre=new Integer(table.getText(table.getRowCount()-1,6)).intValue()+1;
258
		  order=new Integer(table.getText(table.getRowCount()-1,6)).intValue()+1;
-
 
259
	  }*/
252
	  }
260
		  
Line 253... Line 261...
253
		  
261
	  count++;
254
	  count++;
-
 
255
	  HTTPRequest.asyncPost(serviceBaseUrl+"/Inventory/", "identifiant="+user+"&nom_sel="+nom_sel+"&num_nom_sel="+num_nom_sel
-
 
256
			  +"&nom_ret="+nom_ret+"&num_nom_ret="+num_nom_ret+"&num_taxon="+num_taxon+"&famille="+famille+"&ordre="+lastOrdre,
-
 
257
	  new ResponseTextHandler(){
-
 
258
	
-
 
259
	  	public void onCompletion(String str) {
-
 
260
		    	if ((count%VISIBLE_TAXON_COUNT)>0) {
-
 
261
		    		startIndex=count-(count%VISIBLE_TAXON_COUNT); 
262
	  HTTPRequest.asyncPost(serviceBaseUrl+"/Inventory/", "identifiant="+user+"&nom_sel="+nom_sel+"&num_nom_sel="+num_nom_sel
262
		    	}
-
 
263
		    	else {
263
			  +"&nom_ret="+nom_ret+"&num_nom_ret="+num_nom_ret+"&num_taxon="+num_taxon+"&famille="+famille,
264
		    		startIndex=count-VISIBLE_TAXON_COUNT; 
264
			  
265
		    	}
265
	  new ResponseTextHandler(){
266
		    	if (startIndex < 0) {
266
	
Line -... Line 267...
-
 
267
	  	public void onCompletion(String str) {
-
 
268
	  			gotoEnd();
-
 
269
		    	update();
-
 
270
	  	}
-
 
271
	  });
Line 267... Line 272...
267
			  	    startIndex = 0;
272
  }
Line -... Line 273...
-
 
273
 
-
 
274
  /**
-
 
275
   * Suppression d'un element lde l'inventaire, a partir de son numero d'ordre
-
 
276
   *
268
			  	}
277
   */
269
		    	update();
278
 
270
	  	}
279
  
-
 
280
  public void deleteElement() {
271
	  });
281
 
272
  }
282
	  
273
 
283
	  setStatusDisabled();
274
  
284
	  boolean checked=false;
Line 275... Line 285...
275
  public void deleteElement() {
285
 
276
 
-
 
277
	    // Lifo ...
-
 
278
      for (int i=table.getRowCount()-1; i>=0;i--){
-
 
279
		 if (((CheckBox) table.getWidget(i,0)).isChecked())  {
-
 
280
			String str=table.getText(i,6);
286
	    // Lifo ...
281
			count--;
-
 
282
			 HTTPRequest.asyncPost(serviceBaseUrl+"/Inventory/"+user+"/"+str, "action=DELETE", 
287
      for (int i=table.getRowCount()-1; i>=0;i--){
283
			   new ResponseTextHandler(){
288
		 if (((CheckBox) table.getWidget(i,0)).isChecked())  {
284
 
289
			checked=true;
Line 285... Line 290...
285
			   	public void onCompletion(String str) {
290
			String str=table.getText(i,6);
286
			    	if ((count%VISIBLE_TAXON_COUNT)==0) {
291
			count--;
-
 
292
			 HTTPRequest.asyncPost(serviceBaseUrl+"/Inventory/"+user+"/"+str, "action=DELETE", 
-
 
293
			   new ResponseTextHandler(){
-
 
294
 
287
			    		startIndex=count-VISIBLE_TAXON_COUNT; 
295
			   	public void onCompletion(String str) {
Line -... Line 296...
-
 
296
			   		gotoEnd();
-
 
297
			    	update();
-
 
298
			   	}
-
 
299
			  });
-
 
300
 
-
 
301
	  	 }
-
 
302
	  }
-
 
303
      if (!checked) {
-
 
304
    	  setStatusEnabled(); 
-
 
305
      }
-
 
306
  }
-
 
307
 
-
 
308
  /** 
-
 
309
   * 
-
 
310
   * Lancement des initialisations dependantes de réponses asynchrones : le retour d'une demande d'initialisation declanche 
-
 
311
   * la demande d'initialisation suivantes
-
 
312
   * user : resultat recherche nom d'utilisateur
-
 
313
   * count : resultat nombre d'enregistrements d'inventaires
-
 
314
   * affichage enregistrements trouvés 
-
 
315
   *
-
 
316
   */
288
			    	}
317
  private void initAsync() {
-
 
318
	 
-
 
319
	  getUser();
-
 
320
	  // getCount()
-
 
321
	  // update()
289
			    	if (startIndex < 0) {
322
	  
290
				  	    startIndex = 0;
323
  }
Line 291... Line 324...
291
				  	}
324
  
292
			    	update();
325
  /**
Line 313... Line 346...
313
		    
346
		    
Line -... Line 347...
-
 
347
		  
-
 
348
 
314
		  
349
		}  
-
 
350
 
315
 
351
 /**
316
		}  
-
 
Line 317... Line -...
317
 
-
 
318
  
352
  * Recherche nombre d'enregistrement pour l'utilisateur en cours
319
  private void getCount() {
353
  *
Line 320... Line 354...
320
  // Recherche derniere ligne ... (il y a une autre stratégie pour la calculer si le resultat n'arrive pas assez vite)
354
  */ 
Line 321... Line -...
321
 
-
 
322
  
-
 
323
	 HTTPRequest.asyncGet(serviceBaseUrl+"/InventoryList/"+user+"/", 
355
  private void getCount() {
324
		    new ResponseTextHandler(){
356
 
325
 
357
	 HTTPRequest.asyncGet(serviceBaseUrl+"/InventoryList/"+user+"/", 
326
		    	public void onCompletion(String str) {
358
		    new ResponseTextHandler(){
327
 
-
 
328
//On se positionne sur la dernière page ...
-
 
329
		    		
-
 
330
		    		JSONValue jsonValue= JSONParser.parse(str);
-
 
331
		    		JSONNumber jsonNumber;
-
 
332
		    		    if ((jsonNumber = jsonValue.isNumber()) != null) {
-
 
333
		    		    	count=(int) jsonNumber.getValue();
359
 
334
		    		    	if ((count%VISIBLE_TAXON_COUNT)>0) {
-
 
335
		    		    		startIndex=count-(count%VISIBLE_TAXON_COUNT); 
-
 
336
		    		    	}
-
 
337
		    		    	else {
360
		    	public void onCompletion(String str) {
338
		    		    		startIndex=count-VISIBLE_TAXON_COUNT; 
361
 
339
		    		    	}
362
		    		JSONValue jsonValue= JSONParser.parse(str);
340
		    		    	if (startIndex < 0) {
363
		    		JSONNumber jsonNumber;
Line 341... Line 364...
341
		    			  	    startIndex = 0;
364
		    		    if ((jsonNumber = jsonValue.isNumber()) != null) {
Line -... Line 365...
-
 
365
		    		    	count=(int) jsonNumber.getValue();
-
 
366
		    		    	gotoEnd(); // Derniere page
-
 
367
		    		    	update();
-
 
368
		    		    }
-
 
369
		    	}
Line 342... Line 370...
342
		    			  	}
370
	 	});
Line 343... Line -...
343
	 				
-
 
344
		    		    	update();
-
 
Line 345... Line 371...
345
		    		    }
371
 
346
		    	}
-
 
347
	 	});
-
 
348
 
-
 
349
  }
372
  }
350
 
373
 
Line 351... Line 374...
351
  
374
  /**
-
 
375
   * Mise a jour de l'affichage, à partir des données d'inventaire deja saisies.
352
  private void update() {
376
   * La valeur de this.startIndex permet de determiner quelles données seront affichées 
Line 353... Line 377...
353
	  
377
   *
Line 354... Line 378...
354
	  
378
   */
Line 376... Line 400...
376
		                }
400
		                }
Line 377... Line 401...
377
 
401
 
378
 
402
 
379
		    		    int j=0;
-
 
380
		    		    if ((jsonArray = jsonValue.isArray()) != null) {
403
		    		    int j=0;
381
		    		      int i; 	
404
		    		    if ((jsonArray = jsonValue.isArray()) != null) {
382
		    		      for (i = 0; i < jsonArray.size(); ++i) {
405
		    		      for (int i = 0; i < jsonArray.size(); ++i) {
383
		    		    	  if ((jsonArrayNested = jsonArray.get(i).isArray()) != null) {
406
		    		    	  if ((jsonArrayNested = jsonArray.get(i).isArray()) != null) {
384
		    		    		  int row=table.insertRow(table.getRowCount());
407
		    		    		  int row=table.insertRow(table.getRowCount());
385
		    		    		  // Case a cocher
408
		    		    		  // Case a cocher
Line 395... Line 418...
395
		    		    		  // Famille
418
		    		    		  // Famille
396
		    		    		  table.setText(row,5,((JSONString) jsonArrayNested.get(5)).stringValue());
419
		    		    		  table.setText(row,5,((JSONString) jsonArrayNested.get(5)).stringValue());
397
		    		    		  // Numero d'ordre
420
		    		    		  // Numero d'ordre
398
		    		    		  table.setText(row,6,((JSONString) jsonArrayNested.get(6)).stringValue());
421
		    		    		  table.setText(row,6,((JSONString) jsonArrayNested.get(6)).stringValue());
Line 399... Line 422...
399
		    		    		  
422
		    		    		  
400
		    		    		  table.getCellFormatter().setVisible(row,6,true);
423
		    		    		  table.getCellFormatter().setVisible(row,6,false);
401
		    		    		  
424
		    		     		  
402
		    		    		  table.getFlexCellFormatter().setWidth(row,0,"2%");
425
		    		    		  table.getFlexCellFormatter().setWidth(row,0,"2%");
403
		    		    		  table.getFlexCellFormatter().setWidth(row,1,"31%");
426
		    		    		  table.getFlexCellFormatter().setWidth(row,1,"31%");
404
		    		    		  table.getFlexCellFormatter().setWidth(row,2,"31%");
427
		    		    		  table.getFlexCellFormatter().setWidth(row,2,"31%");
405
		    		    		  table.getFlexCellFormatter().setWidth(row,3,"9%");
428
		    		    		  table.getFlexCellFormatter().setWidth(row,3,"9%");
406
		    		    		  table.getFlexCellFormatter().setWidth(row,4,"9%");
429
		    		    		  table.getFlexCellFormatter().setWidth(row,4,"9%");
407
		    		    		  table.getFlexCellFormatter().setWidth(row,5,"18%");
430
		    		    		  table.getFlexCellFormatter().setWidth(row,5,"18%");
408
		    		    		  j++;
431
		    		    		  j++;
Line 409... Line 432...
409
		    		    	  }
432
		    		    	  }
410
		    		    	  
-
 
411
		    		      }
-
 
412
		    		      // Calcul nombre d'enregistrement total (c'est un doublon, c'est normal ...)
-
 
413
		    		      if (i<VISIBLE_TAXON_COUNT) {
433
		    		    	  
414
		    		    	  count = startIndex+i;
-
 
415
		    		      }
-
 
416
		    		      
-
 
417
		    		      // Navigation 
-
 
418
		    		      
-
 
419
 
-
 
420
		    		      // Premiere page 
-
 
421
		    		      if (startIndex<VISIBLE_TAXON_COUNT ) {
-
 
422
		    		    		navBar.gotoPrev.setEnabled(false);
-
 
423
		    		    		navBar.gotoFirst.setEnabled(false);
434
		    		      }
424
		    		    		navBar.gotoNext.setEnabled(true);
-
 
425
		    		    		navBar.gotoEnd.setEnabled(true);
-
 
426
		    		    		if (count < VISIBLE_TAXON_COUNT) {
-
 
427
		    		    			setStatusText((startIndex + 1) + " - " + count );
-
 
428
		    		    		}
-
 
429
		    		    		else {
-
 
430
				    		      setStatusText((startIndex + 1) + " - " + (startIndex + VISIBLE_TAXON_COUNT));
435
		    		    } 
431
		    		    		}
-
 
432
		    		    		
-
 
433
		    		      }
-
 
434
		    		      // Derniere page
-
 
435
		    		      else {
-
 
436
		    		    	  if (startIndex>=(count-VISIBLE_TAXON_COUNT)) {
-
 
437
		    		    		navBar.gotoPrev.setEnabled(true);
-
 
438
		    		    		navBar.gotoFirst.setEnabled(true);
-
 
439
		    		    		navBar.gotoNext.setEnabled(false);
-
 
440
		    		    		navBar.gotoEnd.setEnabled(false);
-
 
441
		    		    		setStatusText((startIndex + 1) + " - " + count);
-
 
442
		    		    	  }
-
 
443
		    		    	  // Page normale 
-
 
444
		    		    	  else {
-
 
445
				    		      navBar.gotoPrev.setEnabled(true);
-
 
446
				    		      navBar.gotoFirst.setEnabled(true);
-
 
447
				    		      navBar.gotoNext.setEnabled(true);
-
 
448
				    		      navBar.gotoEnd.setEnabled(true);
-
 
449
				    		      setStatusText((startIndex + 1) + " - " + (startIndex + VISIBLE_TAXON_COUNT));
-
 
450
		    		    	  }
-
 
451
		    		      }
-
 
452
		    		    }
-
 
453
		    		    // Tableau vide (TODO : despaguettiser)
-
 
454
		    		    if (j==0) {
-
 
455
		    		    	   navBar.gotoPrev.setEnabled(false);
-
 
456
				    		   navBar.gotoFirst.setEnabled(false);
-
 
457
				    		   navBar.gotoNext.setEnabled(false);
-
 
458
				    		   navBar.gotoEnd.setEnabled(false);
-
 
459
				    		   setStatusText(0 + " - " + 0);
436
		    		    setStatusEnabled();
460
		    		    }
437
		    		    
Line 461... Line 438...
461
		    	}
438
		    	}
462
		    });
-
 
463
 
-
 
464
  }
-
 
465
 
-
 
466
private String getServiceBaseUrl() {
-
 
467
	  
-
 
468
	  Dictionary theme = Dictionary.getDictionary("Parameters");
-
 
469
	  return theme.get("serviceBaseUrl");
-
 
470
	  
-
 
Line -... Line 439...
-
 
439
		    });
-
 
440
 
-
 
441
  }
-
 
442
 
-
 
443
  /**
-
 
444
   * Recuperation du prefixe d'appel des services  
-
 
445
   */
-
 
446
  
-
 
447
	private String getServiceBaseUrl() {
-
 
448
		  
-
 
449
		  Dictionary theme = Dictionary.getDictionary("Parameters");
-
 
450
		  return theme.get("serviceBaseUrl");
-
 
451
		  
-
 
452
	
-
 
453
		}  
-
 
454
	
-
 
455
	
-
 
456
	/**
-
 
457
	 * Affichage message d'attente et désactivation navigation
-
 
458
	 * @param 
-
 
459
	 * @return void  
-
 
460
	 */
-
 
461
	
-
 
462
	private void setStatusDisabled() {
-
 
463
		
-
 
464
		navBar.gotoFirst.setEnabled(false);
-
 
465
		navBar.gotoPrev.setEnabled(false);
-
 
466
		navBar.gotoNext.setEnabled(false);
-
 
467
		navBar.gotoEnd.setEnabled(false);
Line -... Line 468...
-
 
468
	
-
 
469
		setStatusText("Patientez ...");
-
 
470
	}
-
 
471
	
-
 
472
 
-
 
473
	/**
-
 
474
	 * Affichage numero de page et gestion de la navigation
-
 
475
	 *
-
 
476
	 */
-
 
477
	
-
 
478
	private void setStatusEnabled() {
-
 
479
	
-
 
480
		// Il y a forcemment un disabled avant d'arriver ici
-
 
481
		
-
 
482
		if (count > 0 ) {	
-
 
483
				
-
 
484
			if (startIndex >= VISIBLE_TAXON_COUNT) { // Au dela de la premiere page
-
 
485
				navBar.gotoPrev.setEnabled(true);
-
 
486
				navBar.gotoFirst.setEnabled(true);
-
 
487
				if (startIndex<(count-VISIBLE_TAXON_COUNT)) {  // Pas la derniere page
-
 
488
					navBar.gotoNext.setEnabled(true);
-
 
489
					navBar.gotoEnd.setEnabled(true);
-
 
490
					setStatusText((startIndex + 1) + " - " + (startIndex + VISIBLE_TAXON_COUNT));
-
 
491
				}
-
 
492
				else { // Derniere page
-
 
493
					setStatusText((startIndex + 1) + " - " + count);
-
 
494
				}
-
 
495
			}
-
 
496
			else {  // Premiere page
-
 
497
				if (count > VISIBLE_TAXON_COUNT) { // Des pages derrieres
-
 
498
					navBar.gotoNext.setEnabled(true);
-
 
499
					navBar.gotoEnd.setEnabled(true);
-
 
500
					setStatusText((startIndex + 1) + " - " + (startIndex + VISIBLE_TAXON_COUNT));
-
 
501
				}
-
 
502
				else {
-
 
503
					setStatusText((startIndex + 1) + " - " + count);
-
 
504
				}
-
 
505
			}
-
 
506
		}
-
 
507
		
-
 
508
		
-
 
509
		else { // Pas d'inventaire, pas de navigation
-
 
510
			 setStatusText(0 + " - " + 0);
-
 
511
		}
-
 
512
	}
-
 
513
	
-
 
514
	
-
 
515
	/**
-
 
516
	 * Positionnement index de parcours (this.startIndex) pour affichage de la dernière page
-
 
517
	 * @param 
-
 
518
	 * @return void  
-
 
519
	 */
-
 
520
	
-
 
521
	private void gotoEnd() {
-
 
522
		
-
 
523
		  	if ( (count==0) || (count%VISIBLE_TAXON_COUNT)>0) {
-
 
524
	    		startIndex=count-(count%VISIBLE_TAXON_COUNT); 
-
 
525
	    	}
-
 
526
	    	else {
471
 
527
	    		startIndex=count-VISIBLE_TAXON_COUNT;