Subversion Repositories eFlore/Applications.del

Rev

Rev 684 | Go to most recent revision | Blame | Last modification | View Log | RSS feed

package org.tela_botanica.del.client.vues.plateformedetermination.forum.interventions;

import org.tela_botanica.del.client.i18n.I18n;
import org.tela_botanica.del.client.modeles.Commentaire;
import org.tela_botanica.del.client.modeles.PropositionDetermination;
import org.tela_botanica.del.client.vues.plateformedetermination.forum.interventions.ForumInterventionPresenteur.Vue;

import com.google.gwt.core.client.GWT;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.IsWidget;
import com.google.gwt.user.client.ui.Widget;

public class ForumInterventionVue extends Composite implements Vue {

        private static ForumUIiBinder uiBinder = GWT.create(ForumUIiBinder.class);

        interface ForumUIiBinder extends UiBinder<Widget, ForumInterventionVue> {
        };

        @UiField
        FlexTable htmlTableau;

        public ForumInterventionVue() {
                initWidget(uiBinder.createAndBindUi(this));
        }

        @Override
        public void ajouterInterventionDetermination(PropositionDetermination determination, IsWidget barreRepartition, IsWidget arbreCommentaires) {

                
                htmlTableau.setHTML(1, 1, I18n.getVocabulary().nom());
                htmlTableau.setHTML(1, 2, I18n.getVocabulary().contributeur());
                htmlTableau.setHTML(1, 3, I18n.getVocabulary().fiabilite());
                htmlTableau.setHTML(1, 4, I18n.getVocabulary().date());
                htmlTableau.setHTML(1, 5, I18n.getVocabulary().commentaire());

                htmlTableau.setWidget(2, 1, barreRepartition);
                htmlTableau.setHTML(2, 2, determination.getAuteur());
                htmlTableau.setHTML(2, 4, DateTimeFormat.getFormat(PredefinedFormat.DATE_SHORT).format(determination.getDate()));
                htmlTableau.setWidget(2, 5, arbreCommentaires);
        
                if (determination.estFils()) {
                        htmlTableau.setStyleName("enfant");
                }
        }

        @Override
        public void ajouterInterventionCommentaire(Commentaire commentaire, IsWidget arbreCommentaires) {

                htmlTableau.setHTML(1, 1, I18n.getVocabulary().contributeur());
                htmlTableau.setHTML(1, 2, I18n.getVocabulary().date());
                htmlTableau.setHTML(1, 3, I18n.getVocabulary().commentaire());

                htmlTableau.setHTML(2, 1, commentaire.getAuteur());
                htmlTableau.setHTML(2, 2, DateTimeFormat.getFormat(PredefinedFormat.DATE_SHORT).format(commentaire.getDate()));
                htmlTableau.setWidget(2, 3, arbreCommentaires);
                
                if (commentaire.estFils()) {
                        htmlTableau.setStyleName("enfant");
                }
        }

}