Subversion Repositories eFlore/Applications.del

Rev

Rev 109 | Blame | 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 NumericFormValidator extends AbstractTextFieldValidator {

        public NumericFormValidator(TextBox textBox) {
                super(textBox);
        }

        @Override
        public boolean validate() {
                try{
                        Integer.parseInt(getTextBox().getText());
                        getTextBox().removeStyleName(getStyleErreur());
                        return true;
                } catch (Exception e) {
                        getTextBox().addStyleName(getStyleErreur());
                        return false;
                }
        }
        
        

}