46 |
aurelien |
1 |
package org.tela_botanica.del.client.vues.plateformedetermination.forum;
|
|
|
2 |
|
70 |
aurelien |
3 |
import org.tela_botanica.del.client.i18n.I18n;
|
140 |
aurelien |
4 |
import org.tela_botanica.del.client.modeles.Commentaire;
|
|
|
5 |
import org.tela_botanica.del.client.modeles.PropositionDetermination;
|
303 |
aurelien |
6 |
import org.tela_botanica.del.client.vues.plateformedetermination.forum.ForumPresenteur.Vue;
|
46 |
aurelien |
7 |
|
|
|
8 |
import com.google.gwt.core.client.GWT;
|
140 |
aurelien |
9 |
import com.google.gwt.i18n.client.DateTimeFormat;
|
|
|
10 |
import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
|
46 |
aurelien |
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;
|
159 |
benjamin |
14 |
import com.google.gwt.user.client.ui.FlexTable;
|
303 |
aurelien |
15 |
import com.google.gwt.user.client.ui.IsWidget;
|
46 |
aurelien |
16 |
import com.google.gwt.user.client.ui.Widget;
|
|
|
17 |
|
303 |
aurelien |
18 |
public class ForumVue extends Composite implements Vue {
|
155 |
benjamin |
19 |
|
46 |
aurelien |
20 |
private static ForumUIiBinder uiBinder = GWT.create(ForumUIiBinder.class);
|
155 |
benjamin |
21 |
|
|
|
22 |
interface ForumUIiBinder extends UiBinder<Widget, ForumVue> {
|
|
|
23 |
};
|
|
|
24 |
|
159 |
benjamin |
25 |
@UiField
|
|
|
26 |
FlexTable htmlTableau;
|
155 |
benjamin |
27 |
|
|
|
28 |
public ForumVue() {
|
46 |
aurelien |
29 |
initWidget(uiBinder.createAndBindUi(this));
|
|
|
30 |
}
|
155 |
benjamin |
31 |
|
658 |
benjamin |
32 |
/*
|
|
|
33 |
* (non-Javadoc)
|
|
|
34 |
*
|
|
|
35 |
* @see org.tela_botanica.del.client.vues.plateformedetermination.forum.Vue#
|
|
|
36 |
* initialiserEntetesTableau()
|
303 |
aurelien |
37 |
*/
|
|
|
38 |
@Override
|
171 |
aurelien |
39 |
public void initialiserEntetesTableau() {
|
155 |
benjamin |
40 |
|
159 |
benjamin |
41 |
htmlTableau.setHTML(1, 1, I18n.getVocabulary().nom());
|
|
|
42 |
htmlTableau.setHTML(1, 2, I18n.getVocabulary().contributeur());
|
|
|
43 |
htmlTableau.setHTML(1, 3, I18n.getVocabulary().fiabilite());
|
|
|
44 |
htmlTableau.setHTML(1, 4, I18n.getVocabulary().date());
|
|
|
45 |
htmlTableau.setHTML(1, 5, I18n.getVocabulary().commentaire());
|
46 |
aurelien |
46 |
}
|
658 |
benjamin |
47 |
|
303 |
aurelien |
48 |
@Override
|
321 |
aurelien |
49 |
public void ajouterLigne(PropositionDetermination determination, IsWidget barreRepartition, IsWidget arbreCommentaires) {
|
658 |
benjamin |
50 |
|
303 |
aurelien |
51 |
int ligne = htmlTableau.getRowCount() + 1;
|
|
|
52 |
htmlTableau.setWidget(ligne, 1, barreRepartition);
|
658 |
benjamin |
53 |
htmlTableau.setHTML(ligne, 2, determination.getAuteur());
|
|
|
54 |
htmlTableau.setHTML(ligne, 4, DateTimeFormat.getFormat(PredefinedFormat.DATE_SHORT).format(determination.getDate()));
|
|
|
55 |
htmlTableau.setWidget(ligne, 5, arbreCommentaires);
|
303 |
aurelien |
56 |
}
|
658 |
benjamin |
57 |
|
|
|
58 |
public void ajouterLigne(Commentaire commentaire, IsWidget arbreCommentaires) {
|
|
|
59 |
|
|
|
60 |
int ligne = htmlTableau.getRowCount() + 1;
|
|
|
61 |
htmlTableau.setHTML(ligne, 2, commentaire.getAuteur());
|
|
|
62 |
htmlTableau.setHTML(ligne, 4, DateTimeFormat.getFormat(PredefinedFormat.DATE_SHORT).format(commentaire.getDate()));
|
|
|
63 |
htmlTableau.setWidget(ligne, 5, arbreCommentaires);
|
|
|
64 |
}
|
|
|
65 |
|
303 |
aurelien |
66 |
@Override
|
171 |
aurelien |
67 |
public FlexTable getTable() {
|
|
|
68 |
return htmlTableau;
|
159 |
benjamin |
69 |
}
|
46 |
aurelien |
70 |
}
|