663 |
benjamin |
1 |
package org.tela_botanica.del.client.vues.plateformedetermination.forum.interventions;
|
|
|
2 |
|
|
|
3 |
import org.tela_botanica.del.client.modeles.Commentaire;
|
|
|
4 |
import org.tela_botanica.del.client.modeles.PropositionDetermination;
|
|
|
5 |
import org.tela_botanica.del.client.vues.plateformedetermination.forum.interventions.ForumInterventionPresenteur.Vue;
|
|
|
6 |
|
|
|
7 |
import com.google.gwt.core.client.GWT;
|
978 |
gduche |
8 |
import com.google.gwt.event.dom.client.HasClickHandlers;
|
1001 |
aurelien |
9 |
import com.google.gwt.event.dom.client.HasMouseOutHandlers;
|
|
|
10 |
import com.google.gwt.event.dom.client.HasMouseOverHandlers;
|
663 |
benjamin |
11 |
import com.google.gwt.i18n.client.DateTimeFormat;
|
|
|
12 |
import com.google.gwt.uibinder.client.UiBinder;
|
|
|
13 |
import com.google.gwt.uibinder.client.UiField;
|
|
|
14 |
import com.google.gwt.user.client.ui.Composite;
|
1001 |
aurelien |
15 |
import com.google.gwt.user.client.ui.FocusPanel;
|
|
|
16 |
import com.google.gwt.user.client.ui.HTML;
|
966 |
gduche |
17 |
import com.google.gwt.user.client.ui.HTMLPanel;
|
978 |
gduche |
18 |
import com.google.gwt.user.client.ui.HasWidgets;
|
|
|
19 |
import com.google.gwt.user.client.ui.Hyperlink;
|
663 |
benjamin |
20 |
import com.google.gwt.user.client.ui.IsWidget;
|
966 |
gduche |
21 |
import com.google.gwt.user.client.ui.Label;
|
663 |
benjamin |
22 |
import com.google.gwt.user.client.ui.Widget;
|
|
|
23 |
|
|
|
24 |
public class ForumInterventionVue extends Composite implements Vue {
|
|
|
25 |
|
|
|
26 |
private static ForumUIiBinder uiBinder = GWT.create(ForumUIiBinder.class);
|
|
|
27 |
|
|
|
28 |
interface ForumUIiBinder extends UiBinder<Widget, ForumInterventionVue> {
|
|
|
29 |
};
|
|
|
30 |
|
|
|
31 |
@UiField
|
1001 |
aurelien |
32 |
FocusPanel proposition;
|
663 |
benjamin |
33 |
|
966 |
gduche |
34 |
@UiField
|
1077 |
gduche |
35 |
Label nom, nomTaxon, date, commentaire, repondre;
|
966 |
gduche |
36 |
|
|
|
37 |
@UiField
|
978 |
gduche |
38 |
HTMLPanel voter, zoneVoter, zoneDetermination, zoneEnfants;
|
966 |
gduche |
39 |
|
978 |
gduche |
40 |
|
1001 |
aurelien |
41 |
@UiField
|
|
|
42 |
FocusPanel conteneurLienSuppression;
|
|
|
43 |
|
|
|
44 |
@UiField
|
|
|
45 |
HTML supprimer;
|
|
|
46 |
|
663 |
benjamin |
47 |
public ForumInterventionVue() {
|
|
|
48 |
initWidget(uiBinder.createAndBindUi(this));
|
|
|
49 |
}
|
1001 |
aurelien |
50 |
|
|
|
51 |
@Override
|
|
|
52 |
public HasClickHandlers getLienSuppression() {
|
|
|
53 |
return conteneurLienSuppression;
|
|
|
54 |
}
|
|
|
55 |
|
|
|
56 |
@Override
|
|
|
57 |
public void afficherLienSuppression() {
|
|
|
58 |
conteneurLienSuppression.setVisible(true);
|
|
|
59 |
}
|
|
|
60 |
|
|
|
61 |
@Override
|
|
|
62 |
public void cacherLienSuppression() {
|
|
|
63 |
conteneurLienSuppression.setVisible(false);
|
|
|
64 |
}
|
663 |
benjamin |
65 |
|
|
|
66 |
@Override
|
|
|
67 |
public void ajouterInterventionDetermination(PropositionDetermination determination, IsWidget barreRepartition, IsWidget arbreCommentaires) {
|
|
|
68 |
|
966 |
gduche |
69 |
nom.setText(determination.getAuteur());
|
|
|
70 |
nomTaxon.setText(determination.getEspece());
|
|
|
71 |
voter.add(barreRepartition);
|
893 |
gduche |
72 |
|
966 |
gduche |
73 |
date.setText(DateTimeFormat.getFormat("dd/MM/yyyy").format(determination.getDate()));
|
|
|
74 |
|
|
|
75 |
commentaire.setText(determination.getCommentaire());
|
893 |
gduche |
76 |
|
|
|
77 |
if (determination.estFils()) {
|
966 |
gduche |
78 |
proposition.setStyleName("enfant");
|
893 |
gduche |
79 |
}
|
663 |
benjamin |
80 |
}
|
|
|
81 |
|
|
|
82 |
@Override
|
966 |
gduche |
83 |
public void ajouterInterventionCommentaire(Commentaire nouveauCommentaire, IsWidget arbreCommentaires) {
|
663 |
benjamin |
84 |
|
968 |
gduche |
85 |
zoneVoter.setVisible(false);
|
|
|
86 |
zoneDetermination.setVisible(false);
|
|
|
87 |
|
966 |
gduche |
88 |
nom.setText(nouveauCommentaire.getAuteur());
|
893 |
gduche |
89 |
|
966 |
gduche |
90 |
date.setText(DateTimeFormat.getFormat("dd/MM/yyyy").format(nouveauCommentaire.getDate()));
|
|
|
91 |
|
|
|
92 |
commentaire.setText(nouveauCommentaire.getCommentaire());
|
|
|
93 |
|
|
|
94 |
if (nouveauCommentaire.estFils()) {
|
|
|
95 |
proposition.setStyleName("enfant");
|
893 |
gduche |
96 |
}
|
663 |
benjamin |
97 |
}
|
978 |
gduche |
98 |
|
|
|
99 |
@Override
|
|
|
100 |
public HasClickHandlers getRepondre() {
|
|
|
101 |
return repondre;
|
|
|
102 |
}
|
663 |
benjamin |
103 |
|
978 |
gduche |
104 |
@Override
|
|
|
105 |
public HasWidgets getEnfants() {
|
|
|
106 |
|
|
|
107 |
return zoneEnfants;
|
|
|
108 |
}
|
|
|
109 |
|
1001 |
aurelien |
110 |
@Override
|
|
|
111 |
public HasMouseOverHandlers getConteneurInterventionMouseOver() {
|
|
|
112 |
return proposition;
|
|
|
113 |
}
|
|
|
114 |
|
|
|
115 |
@Override
|
|
|
116 |
public HasMouseOutHandlers getConteneurInterventionMouseOut() {
|
|
|
117 |
return proposition;
|
|
|
118 |
}
|
|
|
119 |
|
663 |
benjamin |
120 |
}
|