1196 |
gduche |
1 |
package org.tela_botanica.del.client.vues.identiplante.resultats.observationdeterminations;
|
|
|
2 |
|
|
|
3 |
import org.tela_botanica.del.client.i18n.I18n;
|
|
|
4 |
|
|
|
5 |
import com.google.gwt.core.client.GWT;
|
|
|
6 |
import com.google.gwt.event.dom.client.HasClickHandlers;
|
|
|
7 |
import com.google.gwt.uibinder.client.UiBinder;
|
|
|
8 |
import com.google.gwt.uibinder.client.UiField;
|
|
|
9 |
import com.google.gwt.user.client.ui.ClickListener;
|
|
|
10 |
import com.google.gwt.user.client.ui.Composite;
|
|
|
11 |
import com.google.gwt.user.client.ui.FocusPanel;
|
|
|
12 |
import com.google.gwt.user.client.ui.HTML;
|
|
|
13 |
import com.google.gwt.user.client.ui.HTMLPanel;
|
|
|
14 |
import com.google.gwt.user.client.ui.IsWidget;
|
|
|
15 |
import com.google.gwt.user.client.ui.Widget;
|
|
|
16 |
|
|
|
17 |
public class LignePropositionVue extends Composite implements LignePropositionPresenteur.Vue {
|
|
|
18 |
|
|
|
19 |
// Gestion d'UiBinder
|
|
|
20 |
interface MyUiBinder extends UiBinder<Widget, LignePropositionVue> {
|
|
|
21 |
}
|
|
|
22 |
|
|
|
23 |
private static MyUiBinder uibinder = GWT.create(MyUiBinder.class);
|
|
|
24 |
@UiField
|
|
|
25 |
HTMLPanel conteneurPanneauDeterminations;
|
|
|
26 |
|
|
|
27 |
@UiField
|
|
|
28 |
FocusPanel conteneurPanneauVotes, conteneurPanneauCommentaires;
|
|
|
29 |
|
|
|
30 |
@UiField
|
|
|
31 |
HTML nbVotesHtml, nbCommentairesHtml;
|
|
|
32 |
|
|
|
33 |
public LignePropositionVue(IsWidget panneauDeterminations) {
|
|
|
34 |
initWidget(uibinder.createAndBindUi(this));
|
|
|
35 |
conteneurPanneauDeterminations.add(panneauDeterminations);
|
|
|
36 |
conteneurPanneauVotes.setTitle(I18n.getVocabulary().voirDetailVotes());
|
|
|
37 |
conteneurPanneauCommentaires.setTitle(I18n.getVocabulary().voirDetailCommentaires());
|
|
|
38 |
}
|
|
|
39 |
|
|
|
40 |
public HasClickHandlers getZoneNbVotes() {
|
|
|
41 |
return conteneurPanneauVotes;
|
|
|
42 |
}
|
|
|
43 |
|
|
|
44 |
public HasClickHandlers getZoneNbCommentaires() {
|
|
|
45 |
return conteneurPanneauCommentaires;
|
|
|
46 |
}
|
|
|
47 |
|
|
|
48 |
public void setNbVotes(int nbVotes) {
|
|
|
49 |
nbVotesHtml.setHTML(nbVotes + "");
|
|
|
50 |
if (nbVotes == 0) {
|
|
|
51 |
nbVotesHtml.setVisible(false);
|
|
|
52 |
}
|
|
|
53 |
}
|
|
|
54 |
|
|
|
55 |
public void setNbCommentaires(int nbCommentaires) {
|
|
|
56 |
nbCommentairesHtml.setHTML(nbCommentaires + "");
|
|
|
57 |
if (nbCommentaires == 0) {
|
|
|
58 |
nbCommentairesHtml.setVisible(false);
|
|
|
59 |
}
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
public void enleverLienCommentaires() {
|
|
|
63 |
conteneurPanneauCommentaires.setVisible(false);
|
|
|
64 |
}
|
|
|
65 |
|
|
|
66 |
public void enleverLienVotes() {
|
|
|
67 |
nbVotesHtml.setVisible(false);
|
|
|
68 |
conteneurPanneauVotes.removeStyleName("nombreVotes");
|
|
|
69 |
}
|
|
|
70 |
|
|
|
71 |
public void ajouterLienVotes() {
|
|
|
72 |
nbVotesHtml.setVisible(true);
|
|
|
73 |
conteneurPanneauVotes.addStyleName("nombreVotes");
|
|
|
74 |
}
|
1833 |
aurelien |
75 |
|
|
|
76 |
@Override
|
|
|
77 |
public void setPropositionRetenue(boolean propositionRetenue) {
|
|
|
78 |
if(propositionRetenue) {
|
|
|
79 |
addStyleName("propositionRetenuePetit");
|
|
|
80 |
} else {
|
|
|
81 |
removeStyleName("propositionRetenuePetit");
|
|
|
82 |
}
|
|
|
83 |
|
|
|
84 |
}
|
1196 |
gduche |
85 |
}
|