14 |
benjamin |
1 |
package org.tela_botanica.del.client.vues.rechercheobservations;
|
9 |
benjamin |
2 |
|
|
|
3 |
import java.util.List;
|
|
|
4 |
|
|
|
5 |
import org.tela_botanica.del.client.modeles.Observation;
|
14 |
benjamin |
6 |
import org.tela_botanica.del.client.modeles.ObservationValidation;
|
9 |
benjamin |
7 |
|
|
|
8 |
import com.google.gwt.user.client.ui.Composite;
|
|
|
9 |
import com.google.gwt.user.client.ui.HTML;
|
|
|
10 |
import com.google.gwt.user.client.ui.HorizontalPanel;
|
|
|
11 |
import com.google.gwt.user.client.ui.Image;
|
|
|
12 |
import com.google.gwt.user.client.ui.Panel;
|
|
|
13 |
import com.google.gwt.user.client.ui.VerticalPanel;
|
|
|
14 |
|
14 |
benjamin |
15 |
public class ObservationVue extends Composite {
|
9 |
benjamin |
16 |
|
|
|
17 |
private final Panel flowPanel = new VerticalPanel();
|
|
|
18 |
|
|
|
19 |
private final Panel detailsPanel = new VerticalPanel();
|
|
|
20 |
|
|
|
21 |
private final HTML moreDetailsHtml = new HTML(
|
|
|
22 |
"<img src='img/icon_plus.gif' alig='center'>");
|
|
|
23 |
|
|
|
24 |
private final Image waitImage = new Image("img/wait.gif");
|
|
|
25 |
|
|
|
26 |
private final HTML proposeValidationDataHtml = new HTML(
|
|
|
27 |
"<a>Cliquez ici pour proposer votre validation</a>");
|
|
|
28 |
|
|
|
29 |
private final HTML noValidationDataHtml = new HTML(
|
|
|
30 |
"Pas de validation actuellement.");
|
|
|
31 |
|
|
|
32 |
private final Panel ratePanel = new HorizontalPanel();
|
|
|
33 |
|
14 |
benjamin |
34 |
protected ObservationVue() {
|
9 |
benjamin |
35 |
flowPanel.add(waitImage);
|
|
|
36 |
initWidget(flowPanel);
|
|
|
37 |
}
|
|
|
38 |
|
|
|
39 |
protected void loadImage(Observation observation) {
|
|
|
40 |
|
|
|
41 |
flowPanel.clear();
|
|
|
42 |
flowPanel.add(new HTML(observation.getSpecies()));
|
|
|
43 |
flowPanel.add(new HTML(observation.getAuteur()));
|
|
|
44 |
flowPanel.add(new HTML(
|
|
|
45 |
"<a href='http://www.tela-botanica.org/eflore/BDNFF/4.02/nn/"
|
|
|
46 |
+ observation.getNumNomenclatural()
|
|
|
47 |
+ "' target='_blank'><img src='" + observation.getUrl()
|
|
|
48 |
+ "' /img></a>"));
|
|
|
49 |
flowPanel.add(moreDetailsHtml);
|
|
|
50 |
flowPanel.add(detailsPanel);
|
|
|
51 |
flowPanel.add(ratePanel);
|
|
|
52 |
}
|
|
|
53 |
|
|
|
54 |
protected void showValidationData(
|
14 |
benjamin |
55 |
List<ObservationValidation> validationDatas) {
|
9 |
benjamin |
56 |
|
|
|
57 |
if (validationDatas == null || validationDatas.size() == 0) {
|
|
|
58 |
flowPanel.add(noValidationDataHtml);
|
|
|
59 |
}
|
|
|
60 |
flowPanel.add(proposeValidationDataHtml);
|
|
|
61 |
|
|
|
62 |
}
|
|
|
63 |
|
|
|
64 |
protected void clearDetails() {
|
|
|
65 |
detailsPanel.clear();
|
|
|
66 |
moreDetailsHtml.setHTML("<img src='img/icon_plus.gif' >");
|
|
|
67 |
}
|
|
|
68 |
|
|
|
69 |
public Panel getFlowPanel() {
|
|
|
70 |
return flowPanel;
|
|
|
71 |
}
|
|
|
72 |
|
|
|
73 |
public Panel getDetailsPanel() {
|
|
|
74 |
return detailsPanel;
|
|
|
75 |
}
|
|
|
76 |
|
|
|
77 |
public HTML getMoreDetailsHtml() {
|
|
|
78 |
return moreDetailsHtml;
|
|
|
79 |
}
|
|
|
80 |
|
|
|
81 |
public HTML getNoValidationDataHtml() {
|
|
|
82 |
return noValidationDataHtml;
|
|
|
83 |
}
|
|
|
84 |
|
|
|
85 |
public HTML getProposeValidationDataHtml() {
|
|
|
86 |
return proposeValidationDataHtml;
|
|
|
87 |
}
|
|
|
88 |
|
|
|
89 |
public Panel getRatePanel() {
|
|
|
90 |
return ratePanel;
|
|
|
91 |
}
|
|
|
92 |
|
|
|
93 |
}
|