1196 |
gduche |
1 |
package org.tela_botanica.del.client.composants.forum.interventions;
|
|
|
2 |
|
|
|
3 |
import org.tela_botanica.del.client.composants.forum.interventions.ForumInterventionPresenteur.Vue;
|
1830 |
aurelien |
4 |
import org.tela_botanica.del.client.i18n.I18n;
|
1196 |
gduche |
5 |
import org.tela_botanica.del.client.modeles.Commentaire;
|
|
|
6 |
import org.tela_botanica.del.client.modeles.PropositionDetermination;
|
|
|
7 |
|
|
|
8 |
import com.google.gwt.core.client.GWT;
|
|
|
9 |
import com.google.gwt.event.dom.client.HasClickHandlers;
|
|
|
10 |
import com.google.gwt.event.dom.client.HasMouseOutHandlers;
|
|
|
11 |
import com.google.gwt.event.dom.client.HasMouseOverHandlers;
|
|
|
12 |
import com.google.gwt.i18n.client.DateTimeFormat;
|
|
|
13 |
import com.google.gwt.uibinder.client.UiBinder;
|
|
|
14 |
import com.google.gwt.uibinder.client.UiField;
|
1830 |
aurelien |
15 |
import com.google.gwt.user.client.Window;
|
|
|
16 |
import com.google.gwt.user.client.ui.Button;
|
1196 |
gduche |
17 |
import com.google.gwt.user.client.ui.Composite;
|
|
|
18 |
import com.google.gwt.user.client.ui.FocusPanel;
|
|
|
19 |
import com.google.gwt.user.client.ui.HTML;
|
|
|
20 |
import com.google.gwt.user.client.ui.HTMLPanel;
|
|
|
21 |
import com.google.gwt.user.client.ui.HasWidgets;
|
|
|
22 |
import com.google.gwt.user.client.ui.Hyperlink;
|
|
|
23 |
import com.google.gwt.user.client.ui.IsWidget;
|
|
|
24 |
import com.google.gwt.user.client.ui.Label;
|
|
|
25 |
import com.google.gwt.user.client.ui.Panel;
|
|
|
26 |
import com.google.gwt.user.client.ui.Widget;
|
|
|
27 |
|
|
|
28 |
public class ForumInterventionVue extends Composite implements Vue {
|
|
|
29 |
|
|
|
30 |
private static ForumUIiBinder uiBinder = GWT.create(ForumUIiBinder.class);
|
|
|
31 |
|
|
|
32 |
interface ForumUIiBinder extends UiBinder<Widget, ForumInterventionVue> {
|
|
|
33 |
};
|
|
|
34 |
|
|
|
35 |
@UiField
|
|
|
36 |
FocusPanel proposition;
|
|
|
37 |
|
|
|
38 |
@UiField
|
|
|
39 |
Label nom, nomTaxon, date, commentaire, repondre, labelDeterminationProposee;
|
|
|
40 |
|
|
|
41 |
@UiField
|
1830 |
aurelien |
42 |
HTMLPanel conteneurIntermediaireProposition, voter, zoneVoter, zoneDetermination, zoneEnfants;
|
1196 |
gduche |
43 |
|
1830 |
aurelien |
44 |
@UiField
|
|
|
45 |
Button boutonValidationTaxon;
|
1196 |
gduche |
46 |
|
|
|
47 |
@UiField
|
|
|
48 |
FocusPanel conteneurLienSuppression;
|
|
|
49 |
|
|
|
50 |
@UiField
|
|
|
51 |
HTML supprimer, nbVotesHtml;
|
|
|
52 |
|
|
|
53 |
@UiField
|
|
|
54 |
FocusPanel conteneurPanneauVotes;
|
|
|
55 |
|
|
|
56 |
|
|
|
57 |
public ForumInterventionVue() {
|
|
|
58 |
initWidget(uiBinder.createAndBindUi(this));
|
|
|
59 |
}
|
|
|
60 |
|
|
|
61 |
@Override
|
|
|
62 |
public HasClickHandlers getLienSuppression() {
|
|
|
63 |
return conteneurLienSuppression;
|
|
|
64 |
}
|
|
|
65 |
|
|
|
66 |
@Override
|
|
|
67 |
public void afficherLienSuppression() {
|
|
|
68 |
conteneurLienSuppression.removeStyleName("invisible");
|
|
|
69 |
}
|
|
|
70 |
|
|
|
71 |
@Override
|
|
|
72 |
public void cacherLienSuppression() {
|
|
|
73 |
conteneurLienSuppression.addStyleName("invisible");
|
|
|
74 |
}
|
|
|
75 |
|
|
|
76 |
@Override
|
|
|
77 |
public void ajouterInterventionDetermination(PropositionDetermination determination, IsWidget barreRepartition, IsWidget arbreCommentaires) {
|
|
|
78 |
|
|
|
79 |
nom.setText(determination.getAuteur());
|
|
|
80 |
nomTaxon.setText(determination.getEspece());
|
|
|
81 |
|
|
|
82 |
voter.add(barreRepartition);
|
|
|
83 |
|
|
|
84 |
date.setText(DateTimeFormat.getFormat("dd/MM/yyyy").format(determination.getDate()));
|
|
|
85 |
|
|
|
86 |
commentaire.setText(determination.getCommentaire());
|
|
|
87 |
|
|
|
88 |
if (determination.estFils()) {
|
|
|
89 |
proposition.setStyleName("enfant");
|
|
|
90 |
}
|
1830 |
aurelien |
91 |
|
1833 |
aurelien |
92 |
if(determination.estPropositionInitiale()) {
|
|
|
93 |
labelDeterminationProposee.setText(I18n.getVocabulary().determinationOriginalePar());
|
|
|
94 |
labelDeterminationProposee.addStyleName("indicationPropositionInitiale");
|
|
|
95 |
} else {
|
|
|
96 |
labelDeterminationProposee.setText(I18n.getVocabulary().determinationProposeePar());
|
|
|
97 |
}
|
|
|
98 |
|
1830 |
aurelien |
99 |
if(determination.estPropositionRetenue()) {
|
|
|
100 |
proposition.setTitle(I18n.getVocabulary().indicationPropositionValidee());
|
|
|
101 |
proposition.setStyleName("propositionRetenue");
|
|
|
102 |
}
|
|
|
103 |
|
|
|
104 |
boutonValidationTaxon.setTitle(I18n.getVocabulary().indicationValiderProposition());
|
|
|
105 |
conteneurIntermediaireProposition.addStyleName("propositionValidable");
|
1196 |
gduche |
106 |
}
|
|
|
107 |
|
|
|
108 |
@Override
|
|
|
109 |
public void ajouterInterventionCommentaire(Commentaire nouveauCommentaire, IsWidget arbreCommentaires) {
|
|
|
110 |
|
|
|
111 |
zoneVoter.setVisible(false);
|
|
|
112 |
zoneDetermination.setVisible(false);
|
|
|
113 |
|
|
|
114 |
nom.setText(nouveauCommentaire.getAuteur());
|
|
|
115 |
|
|
|
116 |
date.setText(DateTimeFormat.getFormat("dd/MM/yyyy").format(nouveauCommentaire.getDate()));
|
|
|
117 |
|
|
|
118 |
commentaire.setText(nouveauCommentaire.getCommentaire());
|
|
|
119 |
|
|
|
120 |
if (nouveauCommentaire.estFils()) {
|
|
|
121 |
proposition.setStyleName("enfant");
|
|
|
122 |
}
|
1830 |
aurelien |
123 |
|
|
|
124 |
boutonValidationTaxon.setVisible(false);
|
1196 |
gduche |
125 |
}
|
|
|
126 |
|
|
|
127 |
@Override
|
|
|
128 |
public HasClickHandlers getRepondre() {
|
|
|
129 |
return repondre;
|
|
|
130 |
}
|
|
|
131 |
|
|
|
132 |
@Override
|
|
|
133 |
public HasWidgets getEnfants() {
|
|
|
134 |
|
|
|
135 |
return zoneEnfants;
|
|
|
136 |
}
|
|
|
137 |
|
|
|
138 |
@Override
|
|
|
139 |
public HasMouseOverHandlers getConteneurInterventionMouseOver() {
|
|
|
140 |
return proposition;
|
|
|
141 |
}
|
|
|
142 |
|
|
|
143 |
@Override
|
|
|
144 |
public HasMouseOutHandlers getConteneurInterventionMouseOut() {
|
|
|
145 |
return proposition;
|
|
|
146 |
}
|
|
|
147 |
|
|
|
148 |
public HasClickHandlers getEspece() {
|
|
|
149 |
return nomTaxon;
|
|
|
150 |
}
|
|
|
151 |
|
|
|
152 |
public void ajouterLienEspece() {
|
|
|
153 |
nomTaxon.addStyleName("labelLien");
|
|
|
154 |
}
|
|
|
155 |
|
|
|
156 |
public HasClickHandlers getAuteur() {
|
|
|
157 |
return nom;
|
|
|
158 |
}
|
|
|
159 |
|
|
|
160 |
public void ajouterLienAuteur() {
|
|
|
161 |
nom.addStyleName("lien");
|
|
|
162 |
nom.setTitle("Voir le profil");
|
|
|
163 |
}
|
|
|
164 |
|
|
|
165 |
public void cacherDeterminationProposee() {
|
|
|
166 |
labelDeterminationProposee.setVisible(false);
|
|
|
167 |
}
|
|
|
168 |
|
|
|
169 |
@Override
|
|
|
170 |
public void ajouterLienVotes() {
|
|
|
171 |
conteneurPanneauVotes.addStyleName("nombreVotes");
|
|
|
172 |
}
|
|
|
173 |
|
|
|
174 |
public void masquerLienVotes() {
|
|
|
175 |
conteneurPanneauVotes.removeStyleName("nombreVotes");
|
|
|
176 |
nbVotesHtml.setVisible(false);
|
|
|
177 |
}
|
|
|
178 |
|
|
|
179 |
@Override
|
|
|
180 |
public void setNbVotes(int votes) {
|
|
|
181 |
nbVotesHtml.setText(String.valueOf(votes));
|
|
|
182 |
}
|
|
|
183 |
|
1830 |
aurelien |
184 |
@Override
|
1196 |
gduche |
185 |
public HasClickHandlers getZoneNbVotes() {
|
|
|
186 |
return this.conteneurPanneauVotes;
|
|
|
187 |
}
|
1830 |
aurelien |
188 |
|
|
|
189 |
@Override
|
|
|
190 |
public HasClickHandlers getBoutonValidationTaxon() {
|
|
|
191 |
return this.boutonValidationTaxon;
|
|
|
192 |
}
|
|
|
193 |
|
|
|
194 |
@Override
|
|
|
195 |
public void cacherBoutonValidationTaxon() {
|
|
|
196 |
boutonValidationTaxon.setVisible(false);
|
|
|
197 |
}
|
|
|
198 |
|
|
|
199 |
@Override
|
|
|
200 |
public void afficherBoutonValidationTaxon() {
|
|
|
201 |
boutonValidationTaxon.setVisible(true);
|
|
|
202 |
}
|
1196 |
gduche |
203 |
}
|