Subversion Repositories eFlore/Applications.del

Rev

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

Rev 14 Rev 32
Line 3... Line 3...
3
import java.util.List;
3
import java.util.List;
Line 4... Line 4...
4
 
4
 
5
import org.tela_botanica.del.client.modeles.Observation;
5
import org.tela_botanica.del.client.modeles.Observation;
Line -... Line 6...
-
 
6
import org.tela_botanica.del.client.modeles.ObservationValidation;
-
 
7
 
-
 
8
import com.google.gwt.core.client.GWT;
6
import org.tela_botanica.del.client.modeles.ObservationValidation;
9
import com.google.gwt.uibinder.client.UiBinder;
-
 
10
import com.google.gwt.uibinder.client.UiField;
7
 
11
import com.google.gwt.user.client.ui.Composite;
8
import com.google.gwt.user.client.ui.Composite;
-
 
9
import com.google.gwt.user.client.ui.HTML;
12
import com.google.gwt.user.client.ui.FlowPanel;
-
 
13
import com.google.gwt.user.client.ui.HTML;
10
import com.google.gwt.user.client.ui.HorizontalPanel;
14
import com.google.gwt.user.client.ui.Image;
11
import com.google.gwt.user.client.ui.Image;
15
import com.google.gwt.user.client.ui.Label;
Line 12... Line 16...
12
import com.google.gwt.user.client.ui.Panel;
16
import com.google.gwt.user.client.ui.Panel;
Line 13... Line 17...
13
import com.google.gwt.user.client.ui.VerticalPanel;
17
import com.google.gwt.user.client.ui.Widget;
14
 
-
 
15
public class ObservationVue extends Composite {
18
 
16
 
-
 
17
	private final Panel flowPanel = new VerticalPanel();
19
public class ObservationVue extends Composite {
18
 
-
 
19
	private final Panel detailsPanel = new VerticalPanel();
20
 
20
 
-
 
Line 21... Line 21...
21
	private final HTML moreDetailsHtml = new HTML(
21
	// Annotation can be used to change the name of the associated xml file
22
			"<img src='img/icon_plus.gif' alig='center'>");
-
 
Line 23... Line 22...
23
 
22
	// @UiTemplate("ObservationVue.ui.xml")
24
	private final Image waitImage = new Image("img/wait.gif");
23
	interface MyUiBinder extends UiBinder<Widget, ObservationVue> {
Line -... Line 24...
-
 
24
	}
25
 
25
 
Line 26... Line 26...
26
	private final HTML proposeValidationDataHtml = new HTML(
26
	private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);
27
			"<a>Cliquez ici pour proposer votre validation</a>");
27
 
28
 
28
	@UiField
29
	private final HTML noValidationDataHtml = new HTML(
29
	Label nomEspece, nomAuteur, nomObservateur, nomRetenu, dateObservation, famille, localite;
Line 30... Line 30...
30
			"Pas de validation actuellement.");
30
 
Line 31... Line 31...
31
 
31
	@UiField
32
	private final Panel ratePanel = new HorizontalPanel();
32
	Image imagePrincipale;
33
 
33
 
34
	protected ObservationVue() {
34
	public ObservationVue() {
35
		flowPanel.add(waitImage);
35
		// sets listBox
36
		initWidget(flowPanel);
36
		initWidget(uiBinder.createAndBindUi(this));
37
	}
37
	}
38
 
38
 
-
 
39
	protected void loadImage(Observation observation) {
-
 
40
 
-
 
41
		nomEspece.setText(observation.getSpecies());
-
 
42
		nomAuteur.setText(observation.getAuteur());
-
 
43
		imagePrincipale.setUrl(observation.getUrl());
-
 
44
		nomObservateur.setText(observation.getAuteur());
39
	protected void loadImage(Observation observation) {
45
		nomRetenu.setText(observation.getNomRetenu());
40
 
46
		dateObservation.setText(observation.getDate());
41
		flowPanel.clear();
47
		famille.setText(observation.getFamille());
-
 
48
		localite.setText(observation.getLocalite());
42
		flowPanel.add(new HTML(observation.getSpecies()));
49
 
43
		flowPanel.add(new HTML(observation.getAuteur()));
50
		/*
44
		flowPanel.add(new HTML(
-
 
45
				"<a href='http://www.tela-botanica.org/eflore/BDNFF/4.02/nn/"
51
		 * flowPanel.clear(); flowPanel.add(new HTML(observation.getSpecies()));
46
						+ observation.getNumNomenclatural()
52
		 * flowPanel.add(new HTML(observation.getAuteur())); flowPanel.add(new
47
						+ "' target='_blank'><img src='" + observation.getUrl()
53
		 * HTML("<a href='http://www.tela-botanica.org/eflore/BDNFF/4.02/nn/" +
48
						+ "' /img></a>"));
54
		 * observation.getNumNomenclatural() + "' target='_blank'><img src='" +
49
		flowPanel.add(moreDetailsHtml);
-
 
50
		flowPanel.add(detailsPanel);
55
		 * observation.getUrl() + "' /img></a>"));
-
 
56
		 * flowPanel.add(moreDetailsHtml); flowPanel.add(detailsPanel);
Line 51... Line 57...
51
		flowPanel.add(ratePanel);
57
		 * flowPanel.add(ratePanel);
Line 52... Line 58...
52
	}
58
		 */
-
 
59
	}
53
 
60
 
54
	protected void showValidationData(
61
	protected void showValidationData(List<ObservationValidation> validationDatas) {
-
 
62
		/*
55
			List<ObservationValidation> validationDatas) {
63
		 * if (validationDatas == null || validationDatas.size() == 0) {
Line 56... Line 64...
56
 
64
		 * flowPanel.add(noValidationDataHtml); }
57
		if (validationDatas == null || validationDatas.size() == 0) {
65
		 * flowPanel.add(proposeValidationDataHtml);
-
 
66
		 */
58
			flowPanel.add(noValidationDataHtml);
67
 
Line 59... Line 68...
59
		}
68
	}
60
		flowPanel.add(proposeValidationDataHtml);
69
 
-
 
70
	protected void clearDetails() {
61
 
71
		/*
Line 62... Line 72...
62
	}
72
		 * detailsPanel.clear();
63
 
73
		 * moreDetailsHtml.setHTML("<img src='img/icon_plus.gif' >");
-
 
74
		 */
64
	protected void clearDetails() {
75
	}
Line 65... Line 76...
65
		detailsPanel.clear();
76
 
66
		moreDetailsHtml.setHTML("<img src='img/icon_plus.gif' >");
77
	public Panel getFlowPanel() {
-
 
78
		// return flowPanel;
67
	}
79
		return new FlowPanel();
Line 68... Line 80...
68
 
80
	}
69
	public Panel getFlowPanel() {
81
 
-
 
82
	public Panel getDetailsPanel() {
70
		return flowPanel;
83
		// return detailsPanel;
Line 71... Line 84...
71
	}
84
		return new FlowPanel();
72
 
85
	}
-
 
86
 
73
	public Panel getDetailsPanel() {
87
	public HTML getMoreDetailsHtml() {
74
		return detailsPanel;
-
 
75
	}
88
		// return moreDetailsHtml;