Rev 109 | 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 FourCharactersFormValidator extends AbstractTextFieldValidator {
public FourCharactersFormValidator(TextBox textBox, HTML sideHTML) {
super(textBox, sideHTML);
// TODO Auto-generated constructor stub
}
@Override
public boolean validate() {
if(getTextBox().getText().length()>=4){
getSideHTML().setHTML("");
return true;
}
else {
getSideHTML().setHTML("<font color='red'>"+I18n.getVocabulary().auMoins4charcateres()+"</font>");
return false;
}
}
}