Subversion Repositories eFlore/Applications.del

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
101 benjamin 1
package org.tela_botanica.del.client.composants.validation;
2
 
3
import org.tela_botanica.del.client.i18n.I18n;
4
 
5
import com.google.gwt.user.client.ui.HTML;
6
import com.google.gwt.user.client.ui.TextBox;
7
 
8
public class FourCharactersFormValidator extends AbstractTextFieldValidator {
9
 
109 aurelien 10
	public FourCharactersFormValidator(TextBox textBox) {
11
		super(textBox);
101 benjamin 12
		// TODO Auto-generated constructor stub
13
	}
14
 
15
	@Override
16
	public boolean validate() {
17
		if(getTextBox().getText().length()>=4){
109 aurelien 18
			getTextBox().removeStyleName(getStyleErreur());
101 benjamin 19
			return true;
109 aurelien 20
		} else {
21
			getTextBox().addStyleName(getStyleErreur());
101 benjamin 22
			return false;
23
		}
24
	}
25
 
26
}