Subversion Repositories eFlore/Applications.del

Rev

Rev 109 | Rev 228 | Go to most recent revision | 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 TextNotNullFormValidator extends AbstractTextFieldValidator {
        
        public TextNotNullFormValidator(TextBox textBox) {
                super(textBox);
        }

        @Override
        public boolean validate() {
                if (getTextBox().getText().length() >= 0 && !getTextBox().getText().equals("")) {
                        getTextBox().removeStyleName(getStyleErreur());
                        return true;
                } else {
                        getTextBox().addStyleName(getStyleErreur());
                        return false;
                }
        }

}