663 |
benjamin |
1 |
package org.tela_botanica.del.client.vues.plateformedetermination.forum.interventions;
|
|
|
2 |
|
|
|
3 |
import org.tela_botanica.del.client.i18n.I18n;
|
|
|
4 |
import org.tela_botanica.del.client.modeles.Commentaire;
|
|
|
5 |
import org.tela_botanica.del.client.modeles.PropositionDetermination;
|
|
|
6 |
import org.tela_botanica.del.client.vues.plateformedetermination.forum.interventions.ForumInterventionPresenteur.Vue;
|
|
|
7 |
|
|
|
8 |
import com.google.gwt.core.client.GWT;
|
|
|
9 |
import com.google.gwt.i18n.client.DateTimeFormat;
|
|
|
10 |
import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
|
|
|
11 |
import com.google.gwt.uibinder.client.UiBinder;
|
|
|
12 |
import com.google.gwt.uibinder.client.UiField;
|
|
|
13 |
import com.google.gwt.user.client.ui.Composite;
|
|
|
14 |
import com.google.gwt.user.client.ui.FlexTable;
|
913 |
aurelien |
15 |
import com.google.gwt.user.client.ui.HTML;
|
663 |
benjamin |
16 |
import com.google.gwt.user.client.ui.IsWidget;
|
|
|
17 |
import com.google.gwt.user.client.ui.Widget;
|
|
|
18 |
|
|
|
19 |
public class ForumInterventionVue extends Composite implements Vue {
|
|
|
20 |
|
|
|
21 |
private static ForumUIiBinder uiBinder = GWT.create(ForumUIiBinder.class);
|
|
|
22 |
|
|
|
23 |
interface ForumUIiBinder extends UiBinder<Widget, ForumInterventionVue> {
|
|
|
24 |
};
|
|
|
25 |
|
|
|
26 |
@UiField
|
|
|
27 |
FlexTable htmlTableau;
|
|
|
28 |
|
|
|
29 |
public ForumInterventionVue() {
|
|
|
30 |
initWidget(uiBinder.createAndBindUi(this));
|
|
|
31 |
}
|
|
|
32 |
|
|
|
33 |
@Override
|
|
|
34 |
public void ajouterInterventionDetermination(PropositionDetermination determination, IsWidget barreRepartition, IsWidget arbreCommentaires) {
|
|
|
35 |
|
893 |
gduche |
36 |
|
663 |
benjamin |
37 |
htmlTableau.setHTML(1, 1, I18n.getVocabulary().nom());
|
|
|
38 |
htmlTableau.setHTML(1, 2, I18n.getVocabulary().contributeur());
|
|
|
39 |
htmlTableau.setHTML(1, 3, I18n.getVocabulary().fiabilite());
|
|
|
40 |
htmlTableau.setHTML(1, 4, I18n.getVocabulary().date());
|
|
|
41 |
htmlTableau.setHTML(1, 5, I18n.getVocabulary().commentaire());
|
|
|
42 |
|
|
|
43 |
htmlTableau.setWidget(2, 1, barreRepartition);
|
684 |
gduche |
44 |
htmlTableau.setHTML(2, 2, determination.getAuteur());
|
663 |
benjamin |
45 |
htmlTableau.setHTML(2, 4, DateTimeFormat.getFormat(PredefinedFormat.DATE_SHORT).format(determination.getDate()));
|
913 |
aurelien |
46 |
htmlTableau.setWidget(2, 5, new HTML(determination.getCommentaire()));
|
893 |
gduche |
47 |
|
|
|
48 |
if (determination.estFils()) {
|
|
|
49 |
htmlTableau.setStyleName("enfant");
|
|
|
50 |
}
|
663 |
benjamin |
51 |
}
|
|
|
52 |
|
|
|
53 |
@Override
|
|
|
54 |
public void ajouterInterventionCommentaire(Commentaire commentaire, IsWidget arbreCommentaires) {
|
|
|
55 |
|
|
|
56 |
htmlTableau.setHTML(1, 1, I18n.getVocabulary().contributeur());
|
|
|
57 |
htmlTableau.setHTML(1, 2, I18n.getVocabulary().date());
|
|
|
58 |
htmlTableau.setHTML(1, 3, I18n.getVocabulary().commentaire());
|
|
|
59 |
|
|
|
60 |
htmlTableau.setHTML(2, 1, commentaire.getAuteur());
|
|
|
61 |
htmlTableau.setHTML(2, 2, DateTimeFormat.getFormat(PredefinedFormat.DATE_SHORT).format(commentaire.getDate()));
|
|
|
62 |
htmlTableau.setWidget(2, 3, arbreCommentaires);
|
893 |
gduche |
63 |
|
|
|
64 |
if (commentaire.estFils()) {
|
|
|
65 |
htmlTableau.setStyleName("enfant");
|
|
|
66 |
}
|
663 |
benjamin |
67 |
}
|
|
|
68 |
|
|
|
69 |
}
|