477 |
benjamin |
1 |
package org.tela_botanica.del.client.composants.observations;
|
436 |
benjamin |
2 |
|
|
|
3 |
import com.google.gwt.core.client.GWT;
|
|
|
4 |
import com.google.gwt.event.dom.client.ClickHandler;
|
|
|
5 |
import com.google.gwt.uibinder.client.UiBinder;
|
|
|
6 |
import com.google.gwt.uibinder.client.UiField;
|
|
|
7 |
import com.google.gwt.user.client.ui.Composite;
|
1041 |
benjamin |
8 |
import com.google.gwt.user.client.ui.HTML;
|
436 |
benjamin |
9 |
import com.google.gwt.user.client.ui.Image;
|
|
|
10 |
import com.google.gwt.user.client.ui.Panel;
|
|
|
11 |
import com.google.gwt.user.client.ui.Widget;
|
|
|
12 |
|
|
|
13 |
public class ObservationImagesVue extends Composite implements ObservationImagesPresenteur.Vue {
|
|
|
14 |
|
|
|
15 |
// Gestion d'UiBinder
|
|
|
16 |
interface Binder extends UiBinder<Widget, ObservationImagesVue> {
|
|
|
17 |
}
|
|
|
18 |
|
|
|
19 |
private static Binder binder = GWT.create(Binder.class);
|
|
|
20 |
|
|
|
21 |
@UiField
|
|
|
22 |
protected Image photoPrincipale;
|
|
|
23 |
|
|
|
24 |
@UiField
|
|
|
25 |
protected Panel photos;
|
1041 |
benjamin |
26 |
|
1044 |
gduche |
27 |
protected HTML lienPlateforme = new HTML(">>>");
|
436 |
benjamin |
28 |
|
|
|
29 |
|
|
|
30 |
public ObservationImagesVue() {
|
|
|
31 |
initWidget(binder.createAndBindUi(this));
|
|
|
32 |
}
|
|
|
33 |
|
|
|
34 |
public void chargerImagePrincipale(org.tela_botanica.del.client.modeles.Image image) {
|
444 |
aurelien |
35 |
setUrlImagePrincipale(image.getUrlFormat("CRS"));
|
436 |
benjamin |
36 |
setTitreImagePrincipale(image.getUrlFormat("L"));
|
1393 |
aurelien |
37 |
setAltTextImagePrincipale(image.getObservation().getAuteur() + " - " + image.getObservation().getNomRetenuFormateReferentiel());
|
436 |
benjamin |
38 |
}
|
|
|
39 |
|
|
|
40 |
@Override
|
|
|
41 |
public void ajouterPhoto(org.tela_botanica.del.client.modeles.Image imageCourante, ClickHandler gestionnaireClic) {
|
|
|
42 |
Image photo = new Image();
|
|
|
43 |
photo.setUrl(imageCourante.getUrlFormat("CRX2S"));
|
|
|
44 |
photo.setTitle(imageCourante.getUrlFormat("L"));
|
471 |
aurelien |
45 |
photo.setAltText("");
|
436 |
benjamin |
46 |
photo.addClickHandler(gestionnaireClic);
|
|
|
47 |
getPhotos().add(photo);
|
|
|
48 |
}
|
1041 |
benjamin |
49 |
|
|
|
50 |
public void afficherLienPlateformeValidation(){
|
|
|
51 |
getPhotos().add(lienPlateforme);
|
1044 |
gduche |
52 |
lienPlateforme.setStyleName("suiteImages");
|
1041 |
benjamin |
53 |
}
|
436 |
benjamin |
54 |
|
|
|
55 |
public void setUrlImagePrincipale(String url) {
|
|
|
56 |
photoPrincipale.setUrl(url);
|
|
|
57 |
}
|
|
|
58 |
|
|
|
59 |
public void setTitreImagePrincipale(String titre) {
|
|
|
60 |
photoPrincipale.setTitle(titre);
|
|
|
61 |
}
|
|
|
62 |
|
|
|
63 |
public void setAltTextImagePrincipale(String altText) {
|
|
|
64 |
photoPrincipale.setAltText(altText);
|
|
|
65 |
}
|
|
|
66 |
|
|
|
67 |
public String getUrlImagePrincipale() {
|
|
|
68 |
return photoPrincipale.getUrl();
|
|
|
69 |
}
|
|
|
70 |
|
|
|
71 |
public String getTitreImagePrincipale() {
|
|
|
72 |
return photoPrincipale.getTitle();
|
|
|
73 |
}
|
|
|
74 |
|
|
|
75 |
public String getAltTextImagePrincipale() {
|
|
|
76 |
return photoPrincipale.getAltText();
|
|
|
77 |
}
|
|
|
78 |
|
|
|
79 |
public Image getPhotoPrincipale() {
|
|
|
80 |
return photoPrincipale;
|
|
|
81 |
}
|
|
|
82 |
|
|
|
83 |
public Panel getPhotos() {
|
|
|
84 |
return photos;
|
|
|
85 |
}
|
|
|
86 |
|
1041 |
benjamin |
87 |
public HTML getLienPlateforme() {
|
|
|
88 |
return lienPlateforme;
|
|
|
89 |
}
|
|
|
90 |
|
436 |
benjamin |
91 |
}
|