Subversion Repositories eFlore/Archives.cel-v1

Rev

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

Rev 12 Rev 13
Line 28... Line 28...
28
import com.google.gwt.user.client.ui.Composite;
28
import com.google.gwt.user.client.ui.Composite;
29
import com.google.gwt.user.client.ui.FlexTable;
29
import com.google.gwt.user.client.ui.FlexTable;
30
import com.google.gwt.user.client.ui.Grid;
30
import com.google.gwt.user.client.ui.Grid;
31
import com.google.gwt.user.client.ui.HTML;
31
import com.google.gwt.user.client.ui.HTML;
32
import com.google.gwt.user.client.ui.HorizontalPanel;
32
import com.google.gwt.user.client.ui.HorizontalPanel;
-
 
33
import com.google.gwt.user.client.ui.SourcesTableEvents;
-
 
34
import com.google.gwt.user.client.ui.TableListener;
33
import com.google.gwt.user.client.ui.VerticalPanel;
35
import com.google.gwt.user.client.ui.VerticalPanel;
34
import com.google.gwt.user.client.ui.DockPanel;
36
import com.google.gwt.user.client.ui.DockPanel;
35
import com.google.gwt.user.client.ui.Button;
37
import com.google.gwt.user.client.ui.Button;
36
import com.google.gwt.user.client.ui.CheckBox;
38
import com.google.gwt.user.client.ui.CheckBox;
37
import com.google.gwt.user.client.ui.Widget;
39
import com.google.gwt.user.client.ui.Widget;
38
import com.google.gwt.user.client.ui.ClickListener;
40
import com.google.gwt.user.client.ui.ClickListener;
39
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
41
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
40
import com.google.gwt.user.client.ui.HasVerticalAlignment;
42
import com.google.gwt.user.client.ui.HasVerticalAlignment;
41
import com.google.gwt.user.client.ui.Label;
-
 
Line 42... Line 43...
42
 
43
 
43
/*
44
/*
44
 * Le retour de getUser appelle updateCount qui appelle update pour veiller à une
45
 * Le retour de getUser appelle updateCount qui appelle update pour veiller à une
45
 * initialisation correcte
46
 * initialisation correcte
Line 95... Line 96...
95
			bar.setCellHorizontalAlignment(buttons, DockPanel.ALIGN_LEFT);
96
			bar.setCellHorizontalAlignment(buttons, DockPanel.ALIGN_LEFT);
Line 96... Line 97...
96
 
97
 
Line 97... Line -...
97
			bar.setVerticalAlignment(DockPanel.ALIGN_MIDDLE);
-
 
98
			
-
 
99
			
-
 
100
			
-
 
101
			VerticalPanel actions = new VerticalPanel();
-
 
102
			
-
 
103
			
-
 
104
			HorizontalPanel actionButton = new HorizontalPanel();
-
 
105
			
-
 
106
			HTML addButton = new HTML("Nouvelle observation");
-
 
107
			addButton.setStyleName("html_button");
-
 
108
		    addButton.addClickListener(
-
 
109
		    
-
 
110
		    		new ClickListener() {
-
 
111
		    			
-
 
112
		    			public void onClick(Widget w) {
-
 
113
		    				 openEntryPanel();
-
 
114
		    			}
-
 
115
		    			
-
 
116
		    		}
-
 
117
		    
-
 
118
		    
-
 
119
		    );
-
 
120
 
-
 
121
			
-
 
122
		    actionButton.add(addButton);
-
 
123
			
-
 
124
			HTML delButton=new HTML("Suppression");
-
 
125
			delButton.setStyleName("html_button");
-
 
126
			delButton.addClickListener(
-
 
127
			    	new ClickListener() {
-
 
128
			    		public void onClick(Widget sender) {
-
 
129
			    			mediator.getInventoryItemList().deleteElement();
-
 
130
			    		}
-
 
131
			     	}
-
 
132
			);		
-
 
133
			
-
 
134
			actionButton.add(delButton);
-
 
135
		
-
 
136
			HTML exportButton=new HTML("<a href=\""+mediator.getServiceBaseUrl()+"/InventoryExport/" +mediator.getUser()+"\">"+"Tout exporter</a>");
-
 
137
			actionButton.add(exportButton);
-
 
138
			exportButton.setStyleName("html_button");
-
 
139
 
-
 
140
			actionButton.setSpacing(5);
-
 
141
 
-
 
142
			actions.add(actionButton);
-
 
143
 
-
 
144
			
-
 
145
			HorizontalPanel selections = new HorizontalPanel();
-
 
146
			
-
 
147
			selections.setSpacing(3);
-
 
148
			
-
 
149
 
-
 
150
			selections.add(new HTML("S&eacute;lection : "));
-
 
151
			
-
 
152
			Label allLabel = new Label("Tous");
-
 
153
			Label separatorLabel = new Label(",");
-
 
154
			Label noneLabel = new Label("Aucun");
-
 
155
			
-
 
156
			allLabel.setStyleName("selection_label");
-
 
157
			noneLabel.setStyleName("selection_label");
-
 
158
			
-
 
159
			selections.add(allLabel);
-
 
160
			allLabel.addClickListener(
-
 
161
				    	new ClickListener() {
-
 
162
				    		public void onClick(Widget sender) {
-
 
163
				    			selectAll();
-
 
164
				    		}
-
 
165
				     	}
-
 
166
			);		
-
 
167
			
-
 
168
			selections.add(separatorLabel);
-
 
169
			
-
 
170
			selections.add(noneLabel);
-
 
171
			noneLabel.addClickListener(
-
 
172
				    	new ClickListener() {
-
 
173
				    		public void onClick(Widget sender) {
-
 
174
				    			deselectAll();
-
 
175
				    		}
-
 
176
				     	}
-
 
177
			);		
-
 
178
			
-
 
179
 
-
 
180
			actionButton.add(selections);
-
 
181
			
-
 
182
 
-
 
183
			
-
 
184
 
-
 
185
			bar.add(actions, DockPanel.WEST);
-
 
186
 
-
 
187
			
-
 
188
		
98
			bar.setVerticalAlignment(DockPanel.ALIGN_MIDDLE);
Line 189... Line -...
189
			
-
 
190
			
-
 
191
		}
-
 
192
		
-
 
193
		  
-
 
194
		private void openEntryPanel() {
-
 
195
 
-
 
Line 196... Line 99...
196
		             mediator.onEntryClick();
99
			
197
 
100
			
198
		}
101
		}
199
 
102
		
Line 230... Line 133...
230
		navBar.status.setText(text);
133
		navBar.status.setText(text);
231
	}
134
	}
Line 232... Line 135...
232
 
135
 
Line 233... Line 136...
233
	private static final int VISIBLE_TAXON_COUNT = 15;
136
	private static final int VISIBLE_TAXON_COUNT = 15;
Line 234... Line 137...
234
 
137
 
Line 235... Line 138...
235
	private Grid header = new Grid(1, 7);
138
	private Grid header = new Grid(1, 3);
Line 248... Line 151...
248
 
151
 
Line 249... Line 152...
249
	private NavBar navBar=null;
152
	private NavBar navBar=null;
Line -... Line 153...
-
 
153
	
-
 
154
	private Mediator mediator = null;
250
	
155
 
251
	private Mediator mediator = null;
156
	private int  selectedRow = -1;
-
 
157
	
-
 
158
	private String location = "all";
-
 
159
	private String date = "all";
Line 252... Line 160...
252
 
160
	private String search = "all";
Line 253... Line 161...
253
	private String location = "all";
161
 
Line 274... Line 182...
274
		header.setCellPadding(2);
182
		header.setCellPadding(2);
275
		header.setWidth("100%");
183
		header.setWidth("100%");
Line 276... Line 184...
276
 
184
 
Line 277... Line 185...
277
		header.setStyleName("inventoryItem-ListHeader");
185
		header.setStyleName("inventoryItem-ListHeader");
278
 
-
 
279
		header.setText(0, 0, "");
-
 
280
		header.setHTML(0, 1, "Plante observ&eacute;e");
-
 
281
		header.setHTML(0, 2, "R&eacute;f&eacute;rence retenue");
-
 
282
		header.setHTML(0, 3, "R&eacute;f&eacute;rence<br>Nomenclaturale");
-
 
283
		header.setHTML(0, 4, "R&eacute;f&eacute;rence<br>Taxonomique");
-
 
284
		header.setText(0, 5, "Famille");
-
 
285
		header.setText(0, 6, "Commune");
-
 
286
 
-
 
287
		header.getCellFormatter().setWidth(0, 0, "2%");
-
 
288
		header.getCellFormatter().setWidth(0, 1, "31%");
-
 
289
		header.getCellFormatter().setWidth(0, 2, "31%");
-
 
290
		header.getCellFormatter().setWidth(0, 3, "9%");
-
 
291
		header.getCellFormatter().setWidth(0, 4, "9%");
-
 
Line 292... Line 186...
292
		header.getCellFormatter().setWidth(0, 5, "9%");
186
 
Line 293... Line 187...
293
		header.getCellFormatter().setWidth(0, 6, "9%");
187
		header.setWidget(0, 2, navBar);
294
 
188
 
295
		// Mise en forme de la table.
189
		// Mise en forme de la table.
296
 
190
 
-
 
191
		table.setCellSpacing(0);
Line 297... Line 192...
297
		table.setCellSpacing(0);
192
		table.setBorderWidth(0);
Line 298... Line 193...
298
		table.setBorderWidth(0);
193
		table.setCellPadding(2);
Line 299... Line 194...
299
		table.setCellPadding(2);
194
		table.setWidth("100%");
Line 300... Line 195...
300
		table.setWidth("100%");
195
		
301
 
196
 
302
		// Mise en forme barre navigation
197
		// Mise en forme barre navigation
Line 303... Line 198...
303
 
198
 
-
 
199
		navBar.setWidth("100%");
-
 
200
 
-
 
201
		table.setStyleName("inventoryItem-List");
-
 
202
 
-
 
203
		//panel.add(navBar);
-
 
204
		panel.add(header);
-
 
205
		panel.add(table);
-
 
206
 
-
 
207
		
-
 
208
		 // Hook up events.
-
 
209
	    table.addTableListener(new TableListener () {
-
 
210
	    	
-
 
211
			  public void onCellClicked(SourcesTableEvents sender, int row, int cell) {
-
 
212
				   
-
 
213
				  if (table.getWidget(row, 0)!=null) {
304
		navBar.setWidth("100%");
214
				      selectRow(row);
305
 
215
				      // Numero d'ordre
Line 306... Line 216...
306
		table.setStyleName("inventoryItem-List");
216
				      mediator.onInventoryItemSelected(table.getText(row, 4));
Line 307... Line 217...
307
 
217
				  }
Line 308... Line 218...
308
		panel.add(navBar);
218
			  }
-
 
219
 
-
 
220
	    });
-
 
221
	    
-
 
222
		
-
 
223
		//updateCount();
-
 
224
		// update()
-
 
225
 
-
 
226
		
-
 
227
		initWidget(panel);
-
 
228
 
-
 
229
 
-
 
230
	}
-
 
231
	
-
 
232
	
-
 
233
	 
-
 
234
	  private void selectRow(int row) {
-
 
235
		  
-
 
236
		    styleRow(selectedRow, false);
-
 
237
		    styleRow(row, true);
-
 
238
 
-
 
239
		    selectedRow = row;
Line 309... Line 240...
309
		panel.add(header);
240
		    
310
		panel.add(table);
241
		  }
Line 337... Line 268...
337
 
268
 
Line 338... Line 269...
338
	mediator.onAddInventoryItem();
269
	mediator.onAddInventoryItem();
Line -... Line 270...
-
 
270
		
-
 
271
	}
-
 
272
	
-
 
273
 
-
 
274
	// Action sur modification d'un element 
-
 
275
	
-
 
276
	
-
 
277
	public void updateElement() {
-
 
278
	
-
 
279
	
-
 
280
	if (mediator.inventoryItemIsValid()) {
-
 
281
	
-
 
282
		final InventoryItem inventoryItem=mediator.getInventoryItem();
-
 
283
	
-
 
284
		setStatusDisabled();
-
 
285
		
-
 
286
				if (inventoryItem.getNomenclaturalNumber() !=null) {
-
 
287
		
-
 
288
					HTTPRequest.asyncGet(serviceBaseUrl + "/NameValid/" + inventoryItem.getNomenclaturalNumber(),
-
 
289
							new ResponseTextHandler() {
-
 
290
		
-
 
291
								public void onCompletion(String strcomplete) {
-
 
292
		
-
 
293
									JSONValue jsonValue = JSONParser.parse(strcomplete);
-
 
294
									JSONArray jsonArray;
-
 
295
		
-
 
296
									if ((jsonArray = jsonValue.isArray()) != null) {
-
 
297
										// Nom retenu, Num Nomen nom retenu, Num Taxon,
-
 
298
										// Famille
-
 
299
										updateElement(inventoryItem.getOrdre(),inventoryItem.getName(), inventoryItem.getNomenclaturalNumber(),
-
 
300
												((JSONString) jsonArray.get(0))
-
 
301
														.stringValue(),
-
 
302
												((JSONString) jsonArray.get(1))
-
 
303
														.stringValue(),
-
 
304
												((JSONString) jsonArray.get(2))
-
 
305
														.stringValue(),
-
 
306
												((JSONString) jsonArray.get(3))
-
 
307
														.stringValue(),
-
 
308
														inventoryItem.getLocation(),inventoryItem.getLocation_id(),inventoryItem.getDate(),inventoryItem.getComplementlocation(),inventoryItem.getComment());
-
 
309
									}
-
 
310
								}
-
 
311
		
-
 
312
							});
-
 
313
				}
-
 
314
				// Saisie libre
-
 
315
				else {
-
 
316
					updateElement(inventoryItem.getOrdre(),inventoryItem.getName(), " ", " ", " ", " ", " ",inventoryItem.getLocation(),inventoryItem.getLocation_id(),inventoryItem.getDate(),inventoryItem.getComplementlocation(),inventoryItem.getComment());
-
 
317
				}
-
 
318
			
-
 
319
		}
-
 
320
	else {
-
 
321
		return;
-
 
322
	}
-
 
323
	}
-
 
324
 
-
 
325
	
Line 339... Line 326...
339
		
326
	
Line 340... Line 327...
340
	}
327
	// Action sur ajout d'un element 
Line 420... Line 407...
420
	 */
407
	 */
Line 421... Line 408...
421
 
408
 
422
	private void addElement(String nom_sel, String num_nom_sel, String nom_ret,
409
	private void addElement(String nom_sel, String num_nom_sel, String nom_ret,
Line 423... Line -...
423
			String num_nom_ret, String num_taxon, String famille,final String loc, String id_location,String dat, String complementLocation, String comment) {
-
 
Line 424... Line 410...
424
 
410
			String num_nom_ret, String num_taxon, String famille,final String loc, String id_location,String dat, String complementLocation, String comment) {
425
		// Calcul du nouveau numéro d'ordre
411
 
426
 
412
 
427
		count++;
413
		count++;
Line 436... Line 422...
436
			public void onCompletion(String str) {
422
			public void onCompletion(String str) {
437
					location=loc;
423
					location=loc;
438
					if (location.compareTo("")==0) {
424
					if (location.compareTo("")==0) {
439
						location="000null";
425
						location="000null";
440
					}
426
					}
-
 
427
					add=true;
441
					updateCount();
428
					updateCount();
442
			}
429
			}
443
		});
430
		});
444
	}
431
	}
Line -... Line 432...
-
 
432
 
-
 
433
	
-
 
434
 
-
 
435
	/**
-
 
436
	 * Modifie un element de l'inventaire
-
 
437
	 * 
-
 
438
	 * @param ordre : numero d'ordre
-
 
439
	 * @param nom_sel :
-
 
440
	 *            nom selectionne
-
 
441
	 * @param num_nom_sel :
-
 
442
	 *            numero nomenclatural nom selectionne
-
 
443
	 * @param nom_ret :
-
 
444
	 *            nom retenu
-
 
445
	 * @param num_nom_ret :
-
 
446
	 *            numero nomenclaturel nom retenu
-
 
447
	 * @param num_taxon :
-
 
448
	 *            numero taxonomique
-
 
449
	 * @param famille :
-
 
450
	 *            famille
-
 
451
	 */
-
 
452
 
-
 
453
	private void updateElement(String ordre, String nom_sel, String num_nom_sel, String nom_ret,
-
 
454
			String num_nom_ret, String num_taxon, String famille,final String loc, String id_location,String dat, String complementLocation, String comment) {
-
 
455
 
-
 
456
 
-
 
457
		HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" +ordre + "/", "identifiant="
-
 
458
				+ user + "&nom_sel=" + nom_sel + "&num_nom_sel=" + num_nom_sel
-
 
459
				+ "&nom_ret=" + nom_ret + "&num_nom_ret=" + num_nom_ret
-
 
460
				+ "&num_taxon=" + num_taxon + "&famille=" + famille + "&location=" + loc + "&id_location=" + id_location + "&date_observation=" + dat
-
 
461
				+ "&station="+ complementLocation + "&commentaire="+ comment,
-
 
462
 
-
 
463
		new ResponseTextHandler() {
-
 
464
 
-
 
465
			public void onCompletion(String str) {
-
 
466
				add=false;
-
 
467
				update();
-
 
468
			}
-
 
469
		});
-
 
470
	}
-
 
471
 
445
 
472
	
446
	/**
473
	/**
447
	 * Suppression d'un element lde l'inventaire, a partir de son numero d'ordre
474
	 * Suppression d'un element lde l'inventaire, a partir de son numero d'ordre
448
	 * 
475
	 * 
Line 459... Line 486...
459
		for (int i = table.getRowCount() - 1; i >= 0; i--) {
486
		for (int i = table.getRowCount() - 1; i >= 0; i--) {
460
			 if (table.getWidget(i, 0)!=null) {
487
			 if (table.getWidget(i, 0)!=null) {
461
				 if (((CheckBox) table.getWidget(i, 0)).isChecked()) {
488
				 if (((CheckBox) table.getWidget(i, 0)).isChecked()) {
462
					 checked = true;
489
					 checked = true;
463
					 // Numero ordre
490
					 // Numero ordre
464
					 parseChecked.add(table.getText(i, 7));
491
					 parseChecked.add(table.getText(i, 4));
465
					 count--;
492
					 count--;
466
				 }
493
				 }
467
			 }
494
			 }
468
		}
495
		}
469
		StringBuffer ids=new StringBuffer();
496
		StringBuffer ids=new StringBuffer();
Line 512... Line 539...
512
 
539
 
513
	/**
540
	/**
514
	 * Recherche nombre d'enregistrement pour l'utilisateur et la localite en cours
541
	 * Recherche nombre d'enregistrement pour l'utilisateur et la localite en cours
515
	 * 
542
	 * 
516
	 */
543
	 */
Line 517... Line 544...
517
	public void updateCount() {
544
	public void updateCount	() {
Line 518... Line 545...
518
		
545
		
519
		setStatusDisabled();
546
		setStatusDisabled();
520
		
547
		
521
		String adate="all";
548
		String adate="all";
Line 522... Line 549...
522
		if (date.compareTo("all")!=0) {
549
		if (date.compareTo("all")!=0) {
523
			adate=date.substring(6,10)+"-"+date.substring(3,5)+"-"+date.substring(0,2)+" 00:00:00";
550
			adate=date.substring(6,10)+"-"+date.substring(3,5)+"-"+date.substring(0,2)+" 00:00:00";
Line 524... Line 551...
524
		}
551
		}
Line 525... Line 552...
525
 
552
 
Line 545... Line 572...
545
						}
572
						}
546
					}
573
					}
547
				});
574
				});
Line 548... Line 575...
548
 
575
 
-
 
576
	}
-
 
577
	
-
 
578
	
-
 
579
	private String subLeft(String text, int length) {
-
 
580
		return (text.length() < length) ? text : text.substring(0, length)+ " ...";
Line 549... Line 581...
549
	}
581
	} 
550
 
582
 
551
	/**
583
	/**
552
	 * Mise a jour de l'affichage, à partir des données d'inventaire deja
584
	 * Mise a jour de l'affichage, à partir des données d'inventaire deja
Line 556... Line 588...
556
	 *  @param deep : force une mise a jour totale
588
	 *  @param deep : force une mise a jour totale
557
	 */
589
	 */
Line 558... Line 590...
558
 
590
 
Line -... Line 591...
-
 
591
	public void update() {
-
 
592
 
559
	public void update() {
593
	
Line 560... Line 594...
560
 
594
//		table.setBorderWidth(1);
561
		setStatusDisabled();
595
		setStatusDisabled();
562
 
596
 
563
		String adate="all";
597
		String adate="all";
-
 
598
		if (date.compareTo("all")!=0) {
564
		if (date.compareTo("all")!=0) {
599
			adate=date.substring(6,10)+"-"+date.substring(3,5)+"-"+date.substring(0,2)+" 00:00:00";
-
 
600
		}
-
 
601
		
-
 
602
		
-
 
603
		String com;
-
 
604
		if (location.compareTo("all")==0) {
-
 
605
			com="Toutes communes";
-
 
606
		}
-
 
607
		else {
-
 
608
			if (location.compareTo("000null")==0) {
-
 
609
				com="Communes non pr&eacute;cis&eacute;es";
-
 
610
			}
-
 
611
			else {
-
 
612
			com="Commune de "+location;
-
 
613
			}
-
 
614
		}
-
 
615
 
-
 
616
		
-
 
617
		String dat;
-
 
618
		
-
 
619
		if (date.compareTo("all")==0) {
-
 
620
			dat=", toute p&eacute;riode";
-
 
621
		}
-
 
622
		else {
-
 
623
			if (date.compareTo("00/00/0000")==0) {
-
 
624
				dat=", p&eacute;riode non pr&eacute;cis&eacute;";
-
 
625
			}
-
 
626
			else {
-
 
627
				dat=", le "+ date;
-
 
628
			}
-
 
629
		}
565
			adate=date.substring(6,10)+"-"+date.substring(3,5)+"-"+date.substring(0,2)+" 00:00:00";
630
		
566
		}
631
		header.setHTML(0, 0, com +  dat );
Line 567... Line 632...
567
			
632
		
Line 568... Line 633...
568
		HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + location +"/" + adate + "/"+
633
		HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + location +"/" + adate + "/" + search + "/" +
Line 569... Line 634...
569
				+ startIndex + "/" + VISIBLE_TAXON_COUNT,
634
				+ startIndex + "/" + VISIBLE_TAXON_COUNT,
570
 
635
 
571
		new ResponseTextHandler() {
636
		new ResponseTextHandler() {
-
 
637
 
-
 
638
			public void onCompletion(String str) {
-
 
639
 
-
 
640
				JSONValue jsonValue = JSONParser.parse(str);
Line 572... Line 641...
572
 
641
				JSONArray jsonArray;
573
			public void onCompletion(String str) {
642
				JSONArray jsonArrayNested;
574
 
643
				
Line 588... Line 657...
588
							}
657
							}
589
							else {
658
							else {
590
								row = i;
659
								row = i;
591
							}
660
							}
Line -... Line 661...
-
 
661
 
-
 
662
							left=new StringBuffer();
-
 
663
							center=new StringBuffer();
-
 
664
							right=new StringBuffer();
592
 
665
							
593
							// Case a cocher
666
							// Case a cocher
594
							table.setWidget(row, 0, new CheckBox());
667
							table.setWidget(row, 0, new CheckBox());
595
							// Nom saisi
668
							// Nom saisi
596
							
669
 
597
							table.setText(row, 1, ((JSONString) jsonArrayNested
-
 
Line 598... Line 670...
598
									.get(0)).stringValue());
670
							left.append("<b>"+((JSONString) jsonArrayNested .get(0)).stringValue()+"</b>");
599
							
671
							
Line 600... Line 672...
600
							// Nom retenu
672
							// Nom retenu
601
							String aname=((JSONString) jsonArrayNested .get(2)).stringValue();
-
 
602
							
673
							String aname=((JSONString) jsonArrayNested .get(2)).stringValue();
603
							if (aname.compareTo("null")==0) {
674
							
604
								table.setText(row, 2, "");
675
							if (aname.compareTo("null")==0) {
605
							}
676
							}
Line 606... Line 677...
606
							else {
677
							else {
607
								table.setText(row, 2, aname);
678
								center.append(aname+", ");
Line 608... Line 679...
608
							}
679
							}
609
							
680
							
610
							// Num nomenclatural
681
							// Num nomenclatural
611
							String ann=((JSONString) jsonArrayNested .get(3)).stringValue();
682
							String ann=((JSONString) jsonArrayNested .get(3)).stringValue();
612
							
683
							
613
							if (ann.compareTo("0")==0) {
684
							if (ann.compareTo("0")!=0) {
Line 614... Line 685...
614
								table.setText(row, 3, "");
685
								center.append(""+ann+"-");
Line 615... Line 686...
615
							}
686
							}
Line 616... Line 687...
616
							else {
687
							else {
617
								table.setText(row, 3, ann);
688
								center.append("0-");
618
							}
689
							}
619
 
690
 
620
							
691
							
621
							// Num Taxonomique
692
							// Num Taxonomique
Line 622... Line 693...
622
							
693
							
623
							String ant=((JSONString) jsonArrayNested .get(4)).stringValue();
694
							String ant=((JSONString) jsonArrayNested .get(4)).stringValue();
Line 624... Line 695...
624
							
695
							
625
							if (ant.compareTo("0")==0) {
696
							if (ant.compareTo("0")!=0) {
626
								table.setText(row, 4, "");
697
								center.append(ant+", ");
627
							}
698
							}
628
							else {
699
							else {
629
								table.setText(row, 4, ann);
700
								center.append("0, ");
Line 630... Line 701...
630
							}
701
							}
-
 
702
 
-
 
703
							// Famille
-
 
704
							String afamily=((JSONString) jsonArrayNested .get(5)).stringValue();
631
 
705
							
632
							// Famille
706
							if (afamily.compareTo("null")==0) {
-
 
707
								//
-
 
708
							}
633
							String afamily=((JSONString) jsonArrayNested .get(5)).stringValue();
709
							else {
-
 
710
								center.append(afamily+", ");
-
 
711
							}
-
 
712
 
-
 
713
							
-
 
714
							String aloc=((JSONString) jsonArrayNested .get(6)).stringValue();
-
 
715
//								Localisation - Lieu
-
 
716
								
634
							
717
								if (aloc.compareTo("000null")==0) {
-
 
718
									if (center.length()==0) {
-
 
719
										center.append("Commune absente");
-
 
720
									}
Line -... Line 721...
-
 
721
									else {
635
							if (afamily.compareTo("null")==0) {
722
										center.append("commune absente");
Line -... Line 723...
-
 
723
									}
-
 
724
								}
636
								table.setText(row, 5, "");
725
								else {
-
 
726
									if (center.length()==0) {
-
 
727
										center.append("Commune de "+aloc);
Line 637... Line 728...
637
							}
728
									}
-
 
729
									else {
-
 
730
										center.append("commune de "+aloc);
-
 
731
									}
-
 
732
										
-
 
733
								}
Line 638... Line -...
638
							else {
-
 
-
 
734
							
Line 639... Line -...
639
								table.setText(row, 5, afamily);
-
 
Line -... Line 735...
-
 
735
								
-
 
736
								String alieudit=((JSONString) jsonArrayNested .get(9)).stringValue();
-
 
737
							
-
 
738
//								Localisation - Lieu dit
640
							}
739
								
641
 
740
								if (alieudit.compareTo("null")!=0) {
642
							
741
									center.append(", "+alieudit);
643
							table.getFlexCellFormatter().setWidth(row, 0, "2%");
742
								}
644
							table.getFlexCellFormatter()
743
							
645
									.setWidth(row, 1, "31%");
744
								String acomment=((JSONString) jsonArrayNested .get(10)).stringValue();
Line 646... Line -...
646
							table.getFlexCellFormatter()
-
 
647
									.setWidth(row, 2, "31%");
-
 
Line 648... Line -...
648
							
-
 
649
						// TODO : Bool ici non ?	
-
 
Line 650... Line -...
650
							
-
 
651
							// Affichage contenu commune si tout demandé.
-
 
652
							
-
 
653
							String aloc=((JSONString) jsonArrayNested .get(6)).stringValue();
-
 
654
							
-
 
655
							if (location.compareTo("all")==0) {
-
 
656
								
-
 
657
//								Localisation - Lieu
-
 
658
								
-
 
Line 659... Line -...
659
								if (aloc.compareTo("000null")==0) {
-
 
660
									table.setText(row, 6, "Inconnu");
-
 
661
								}
-
 
662
								else {
-
 
663
									table.setText(row, 6, aloc );
-
 
664
								}
-
 
Line -... Line 745...
-
 
745
//								Commentaire
-
 
746
								
-
 
747
								if (acomment.compareTo("null")!=0) {
-
 
748
									center.append(", "+acomment);
-
 
749
								}
-
 
750
							
-
 
751
 
665
								
752
								
-
 
753
								
-
 
754
								
-
 
755
								String adate=((JSONString) jsonArrayNested .get(8)).stringValue();
-
 
756
								
-
 
757
//								Date 
-
 
758
								if (adate.compareTo("0000-00-00 00:00:00")!=0) {
Line -... Line 759...
-
 
759
									right.append("<b>"+adate+"</b>"); 
-
 
760
								}
666
 
761
								else {
667
								header.getCellFormatter().setVisible(0, 6,true);
762
//									right.append("<b>00/00/0000</b>"); 
-
 
763
								}
-
 
764
								
-
 
765
							
-
 
766
 
-
 
767
							
-
 
768
								
-
 
769
								
-
 
770
							table.setHTML(row, 1, subLeft("&nbsp;"+left,40));
-
 
771
							table.setHTML(row, 2, subLeft("&nbsp;"+center,120));
-
 
772
							table.setHTML(row, 3, subLeft("&nbsp;"+right,25));
668
							
773
							
-
 
774
							table.getRowFormatter().removeStyleName(row, "inventoryItem-SelectedRow");
-
 
775
							
Line 669... Line 776...
669
								table.getFlexCellFormatter().setWidth(row, 1, "31%");
776
						
Line 670... Line 777...
670
								table.getFlexCellFormatter().setWidth(row, 2, "31%");
777
							table.getCellFormatter().setWordWrap(row,1,false);
Line 671... Line 778...
671
 
778
							table.getCellFormatter().setWidth(row,1,"10%");
672
								table.getFlexCellFormatter().setWidth(row, 3, "9%");
779
							table.getCellFormatter().setWordWrap(row,2,false);
Line 673... Line 780...
673
								table.getFlexCellFormatter().setWidth(row, 4, "9%");
780
							table.getCellFormatter().setWordWrap(row,3,false);
-
 
781
							table.getCellFormatter().setWidth(row,3,"7%");
674
								table.getFlexCellFormatter().setWidth(row, 5, "9%");
782
							
675
								table.getFlexCellFormatter().setWidth(row, 6, "9%");
783
							
-
 
784
							String aordre=((JSONString) jsonArrayNested.get(7)).stringValue();
676
 
785
						
677
							}
786
							// Numero d'ordre (caché)
-
 
787
							table.setText(row, 4, aordre);
-
 
788
 
678
							else {
789
							if (add){
-
 
790
								if (i ==(arraySize -1)) {
-
 
791
									selectRow(row);
Line 679... Line 792...
679
								header.getCellFormatter().setVisible(0, 6,false);
792
									mediator.getEntryPanel().setOrdre(aordre);
Line -... Line 793...
-
 
793
								}
680
								table.getCellFormatter().setVisible(row, 6,false);
794
								
681
							
795
							}
-
 
796
							else {
Line 682... Line 797...
682
								table.getFlexCellFormatter().setWidth(row, 1, "36%");
797
								if ((mediator.getEntryPanel().getOrdre()!=null) && (mediator.getEntryPanel().getOrdre().compareTo(aordre)==0)) {
Line 683... Line 798...
683
								table.getFlexCellFormatter().setWidth(row, 2, "36%");
798
									selectRow(row);
Line 792... Line 907...
792
		}
907
		}
Line 793... Line 908...
793
 
908
 
Line 794... Line 909...
794
	}
909
	}
-
 
910
 
-
 
911
	/*
-
 
912
	 * Recherche en cours
-
 
913
	 * 
-
 
914
	 */
-
 
915
	
-
 
916
	public void setSearch(String search) {
-
 
917
		this.search = search;
-
 
918
	}
-
 
919
 
-
 
920
 
795
 
921
	
796
	/*
922
	/*
797
	 * Localite en cours 
923
	 * Localite en cours 
Line 798... Line 924...
798
	 * 
924
	 *