Subversion Repositories eFlore/Applications.del

Rev

Rev 305 | Blame | Compare with Previous | Last modification | View Log | RSS feed

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

import org.tela_botanica.del.client.i18n.I18n;

import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.TextBox;

public class ValidateurChampNCaracteres extends ValidateurChampTexteAbstrait {

        private int nbCaracteres = 0;
        
        public ValidateurChampNCaracteres(TextBox textBox) {
                super(textBox);
                // TODO Auto-generated constructor stub
        }
        
        public void setNbCaracteres(int nbCaracteresMax) {
                nbCaracteres = nbCaracteresMax;
        }

        @Override
        public boolean valider() {
                if(getTextBox().getText().length()>=nbCaracteres){
                        supprimerStyleErreur(getStyleErreur());
                        return true;
                } else {
                        afficherStyleErreur(getStyleErreur());
                        return false;
                }
        }

}