Subversion Repositories eFlore/Applications.del

Rev

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

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

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.HasClickHandlers;
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.HasText;
import com.google.gwt.user.client.ui.Hyperlink;
import com.google.gwt.user.client.ui.InlineLabel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;

public class MetadonneesVue extends Composite implements MetadonneesPresenteur.Vue {
        // Gestion d'UiBinder
        interface Binder extends UiBinder<Widget, MetadonneesVue> {
        }

        private static Binder binder = GWT.create(Binder.class);

        @UiField
        Hyperlink nomRetenu, famille, auteur, localite, motsClefs, numNomenclatural, nomCommun, commentaire, milieu;

        @UiField
        HTML lieuDit;

        @UiField
        InlineLabel dateReleve, dateTransmission;

        public MetadonneesVue() {
                initWidget(binder.createAndBindUi(this));
        }

        public HasText getNomRetenu() {
                return this.nomRetenu;
        }

        public HasText getFamille() {
                return this.famille;
        }

        public HasText getAuteur() {
                return this.auteur;
        }

        public HasText getDateTransmission() {
                return this.dateTransmission;
        }

        public HasText getDateReleve() {
                return this.dateReleve;
        }

        public HasText getLocalite() {
                return this.localite;
        }

        public HasText getMotsClefs() {
                return this.motsClefs;
        }

        public HasText getNumNomenclatural() {
                return this.numNomenclatural;
        }

        public HasText getNomCommun() {
                return nomCommun;
        }

        public HasText getLieuDit() {
                return lieuDit;
        }

        public HasText getMilieu() {
                return milieu;
        }

        public HasText getCommentaire() {
                return commentaire;
        }

        @Override
        public HasClickHandlers getLienNomRetenu() {
                return nomRetenu;
        }

        public HasClickHandlers getLienFamille() {
                return this.famille;
        }

        public HasClickHandlers getLienAuteur() {
                return this.auteur;
        }

        public HasClickHandlers getLienDateTransmission() {
                return this.dateTransmission;
        }

        public HasClickHandlers getLienDateReleve() {
                return this.dateReleve;
        }

        public HasClickHandlers getLienLocalite() {
                return this.localite;
        }

        public HasClickHandlers getLienMotsClefs() {
                return this.motsClefs;
        }

        public HasClickHandlers getLienNumNomenclatural() {
                return this.numNomenclatural;
        }

        public HasClickHandlers getLienNomCommun() {
                return nomCommun;
        }

        public HasClickHandlers getLienMilieu() {
                return milieu;
        }

        public HasClickHandlers getLienCommentaire() {
                return commentaire;
        }

        @Override
        public void masquerChampsVides() {
                HasText[] champs = {nomRetenu, nomCommun, famille, localite, auteur,  motsClefs,  commentaire, milieu, lieuDit, dateReleve, dateTransmission};
                for (int i = 0; i < champs.length; i ++) {
                        HasText champ = champs[i];
                        if ("".equals(champ.getText())) {
                                Widget widget = (Widget) champ;
                                widget.getParent().setVisible(false);
                        }
                }
        }

}