Subversion Repositories eFlore/Applications.del

Rev

Rev 41 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 41 Rev 46
Line 11... Line 11...
11
import com.google.gwt.user.client.ui.Composite;
11
import com.google.gwt.user.client.ui.Composite;
12
import com.google.gwt.user.client.ui.HTML;
12
import com.google.gwt.user.client.ui.HTML;
13
import com.google.gwt.user.client.ui.HasWidgets;
13
import com.google.gwt.user.client.ui.HasWidgets;
14
import com.google.gwt.user.client.ui.Widget;
14
import com.google.gwt.user.client.ui.Widget;
Line 15... Line 15...
15
 
15
 
-
 
16
public class ForumPresenteur {
-
 
17
	
Line 16... Line 18...
16
public class Forum extends Composite {
18
	private ForumVue forumVue = new ForumVue();
17
 
19
 
18
	private final MockDatasource validationService = MockDatasource.getInstance();	
20
	private final MockDatasource validationService = MockDatasource.getInstance();	
19
	private List<ObservationDetermination> determinations; 
-
 
20
	
-
 
21
	private static ForumUIiBinder uiBinder = GWT.create(ForumUIiBinder.class);
-
 
22
	interface ForumUIiBinder extends UiBinder<Widget, Forum>{};
-
 
23
	
-
 
24
	@UiField(provided = true) 
-
 
25
	HTML htmlTableau = new HTML();
21
	private List<ObservationDetermination> determinations; 
26
	
22
		
27
	private String idObservation = "0";
23
	private String idObservation = "0";
-
 
24
	
28
 
25
	public void go(HasWidgets composite) {
29
	public void go(HasWidgets composite) {
26
		
30
		loadCommentaires();
-
 
31
		creerTableauForum(determinations);
27
		chargerCommentaires();
Line 32... Line 28...
32
		initWidget(uiBinder.createAndBindUi(this));
28
		composite.add(forumVue);
33
	}
29
	}
34
	
-
 
35
	private void loadCommentaires() {
-
 
36
		determinations = validationService.getDeterminationData(idObservation);	
-
 
37
	}
-
 
38
	
-
 
39
	public void creerTableauForum(List<ObservationDetermination> determinations) {
-
 
40
			String ligne = "<table>"+
-
 
41
			"<tr>"+
-
 
42
			"<th> Espèce </th>"+
-
 
43
			"<th> Contributeur </th>"+
-
 
44
			"<th> Fiabilité </th>"+
-
 
45
			"<th> Date de transmission </th>"+
30
	
46
			"<th> Commentaires </th>"+
-
 
47
			"</tr>";
-
 
48
		for (ObservationDetermination observationDetermination : determinations) {
-
 
49
			ligne += "<tr>"+
-
 
50
							"<td>"+observationDetermination.getEspece()+"</td>"+
-
 
51
							"<td>"+observationDetermination.getContributeur()+"</td>"+
-
 
52
							"<td>"+observationDetermination.getPourcentageConfiance()+"%</td>"+
-
 
53
							"<td>"+observationDetermination.getDateCommentaire()+"</td>"+
-
 
54
							"<td>"+observationDetermination.getCommentaire()+"</td>"+
-
 
55
					"</tr>";
-
 
56
		}
31
	private void chargerCommentaires() {
57
		ligne += "</table>";
32
		determinations = validationService.getDeterminationData(idObservation);