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