Subversion Repositories eFlore/Applications.del

Rev

Rev 228 | Go to most recent revision | Details | Compare with Previous | 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
 
228 aurelien 8
public class ValidateurChampNCaracteres extends ValidateurChampTexteAbstrait {
101 benjamin 9
 
228 aurelien 10
	private int nbCaracteres = 0;
11
 
12
	public ValidateurChampNCaracteres(TextBox textBox) {
109 aurelien 13
		super(textBox);
101 benjamin 14
		// TODO Auto-generated constructor stub
15
	}
228 aurelien 16
 
17
	public void setNbCaracteres(int nbCaracteresMax) {
18
		nbCaracteres = nbCaracteresMax;
19
	}
101 benjamin 20
 
21
	@Override
228 aurelien 22
	public boolean valider() {
23
		if(getTextBox().getText().length()>=nbCaracteres){
305 aurelien 24
			supprimerStyleErreur(getStyleErreur());
101 benjamin 25
			return true;
109 aurelien 26
		} else {
305 aurelien 27
			afficherStyleErreur(getStyleErreur());
101 benjamin 28
			return false;
29
		}
30
	}
31
 
32
}