Subversion Repositories eFlore/Applications.del

Rev

Rev 1151 | Rev 1162 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

package org.tela_botanica.del.client.composants.motsclesimages;

import java.util.List;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasWidgets;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.Widget;

public class MotsClesImageVue extends Composite  implements MotsClesImagePresenteur.Vue {
        
        @UiField
        public HTML motsCles;
        
        @UiField
        public Panel saisieMotsCles;

        interface MyUiBinder extends UiBinder<Widget, MotsClesImageVue> {
                
        }

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

        public MotsClesImageVue() {
                // sets listBox
                initWidget(uiBinder.createAndBindUi(this));
        }

        @Override
        public void afficherMotsCles(List<String> listeMotsCles) {
                String chaine = "";
                Object[] tabMotsCles = listeMotsCles.toArray();
                int nbMc = tabMotsCles.length;
                for (int i = 0; i < tabMotsCles.length; i++) {
                        String string = (String)tabMotsCles[i];
                        chaine += "<span class=\"motCleImage\">"+string+"</span>";
                        chaine += (i != (nbMc - 1)) ? " " : "";
                }
                motsCles.setHTML(chaine);
        }
        
        @Override
        public HasWidgets getZoneSaisieMotsCles() {
                return saisieMotsCles;
        }
}