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 |
|
|
|
92 |
if(determination.estPropositionRetenue()) {
|
|
|
93 |
proposition.setTitle(I18n.getVocabulary().indicationPropositionValidee());
|
|
|
94 |
proposition.setStyleName("propositionRetenue");
|
|
|
95 |
}
|
|
|
96 |
|
|
|
97 |
boutonValidationTaxon.setTitle(I18n.getVocabulary().indicationValiderProposition());
|
|
|
98 |
conteneurIntermediaireProposition.addStyleName("propositionValidable");
|
1196 |
gduche |
99 |
}
|
|
|
100 |
|
|
|
101 |
@Override
|
|
|
102 |
public void ajouterInterventionCommentaire(Commentaire nouveauCommentaire, IsWidget arbreCommentaires) {
|
|
|
103 |
|
|
|
104 |
zoneVoter.setVisible(false);
|
|
|
105 |
zoneDetermination.setVisible(false);
|
|
|
106 |
|
|
|
107 |
nom.setText(nouveauCommentaire.getAuteur());
|
|
|
108 |
|
|
|
109 |
date.setText(DateTimeFormat.getFormat("dd/MM/yyyy").format(nouveauCommentaire.getDate()));
|
|
|
110 |
|
|
|
111 |
commentaire.setText(nouveauCommentaire.getCommentaire());
|
|
|
112 |
|
|
|
113 |
if (nouveauCommentaire.estFils()) {
|
|
|
114 |
proposition.setStyleName("enfant");
|
|
|
115 |
}
|
1830 |
aurelien |
116 |
|
|
|
117 |
boutonValidationTaxon.setVisible(false);
|
1196 |
gduche |
118 |
}
|
|
|
119 |
|
|
|
120 |
@Override
|
|
|
121 |
public HasClickHandlers getRepondre() {
|
|
|
122 |
return repondre;
|
|
|
123 |
}
|
|
|
124 |
|
|
|
125 |
@Override
|
|
|
126 |
public HasWidgets getEnfants() {
|
|
|
127 |
|
|
|
128 |
return zoneEnfants;
|
|
|
129 |
}
|
|
|
130 |
|
|
|
131 |
@Override
|
|
|
132 |
public HasMouseOverHandlers getConteneurInterventionMouseOver() {
|
|
|
133 |
return proposition;
|
|
|
134 |
}
|
|
|
135 |
|
|
|
136 |
@Override
|
|
|
137 |
public HasMouseOutHandlers getConteneurInterventionMouseOut() {
|
|
|
138 |
return proposition;
|
|
|
139 |
}
|
|
|
140 |
|
|
|
141 |
public HasClickHandlers getEspece() {
|
|
|
142 |
return nomTaxon;
|
|
|
143 |
}
|
|
|
144 |
|
|
|
145 |
public void ajouterLienEspece() {
|
|
|
146 |
nomTaxon.addStyleName("labelLien");
|
|
|
147 |
}
|
|
|
148 |
|
|
|
149 |
public HasClickHandlers getAuteur() {
|
|
|
150 |
return nom;
|
|
|
151 |
}
|
|
|
152 |
|
|
|
153 |
public void ajouterLienAuteur() {
|
|
|
154 |
nom.addStyleName("lien");
|
|
|
155 |
nom.setTitle("Voir le profil");
|
|
|
156 |
}
|
|
|
157 |
|
|
|
158 |
public void cacherDeterminationProposee() {
|
|
|
159 |
labelDeterminationProposee.setVisible(false);
|
|
|
160 |
}
|
|
|
161 |
|
|
|
162 |
@Override
|
|
|
163 |
public void ajouterLienVotes() {
|
|
|
164 |
conteneurPanneauVotes.addStyleName("nombreVotes");
|
|
|
165 |
}
|
|
|
166 |
|
|
|
167 |
public void masquerLienVotes() {
|
|
|
168 |
conteneurPanneauVotes.removeStyleName("nombreVotes");
|
|
|
169 |
nbVotesHtml.setVisible(false);
|
|
|
170 |
}
|
|
|
171 |
|
|
|
172 |
@Override
|
|
|
173 |
public void setNbVotes(int votes) {
|
|
|
174 |
nbVotesHtml.setText(String.valueOf(votes));
|
|
|
175 |
}
|
|
|
176 |
|
1830 |
aurelien |
177 |
@Override
|
1196 |
gduche |
178 |
public HasClickHandlers getZoneNbVotes() {
|
|
|
179 |
return this.conteneurPanneauVotes;
|
|
|
180 |
}
|
1830 |
aurelien |
181 |
|
|
|
182 |
@Override
|
|
|
183 |
public HasClickHandlers getBoutonValidationTaxon() {
|
|
|
184 |
return this.boutonValidationTaxon;
|
|
|
185 |
}
|
|
|
186 |
|
|
|
187 |
@Override
|
|
|
188 |
public void cacherBoutonValidationTaxon() {
|
|
|
189 |
boutonValidationTaxon.setVisible(false);
|
|
|
190 |
}
|
|
|
191 |
|
|
|
192 |
@Override
|
|
|
193 |
public void afficherBoutonValidationTaxon() {
|
|
|
194 |
boutonValidationTaxon.setVisible(true);
|
|
|
195 |
}
|
1196 |
gduche |
196 |
}
|