Subversion Repositories eFlore/Applications.del

Rev

Rev 101 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 101 Rev 109
Line 5... Line 5...
5
import com.google.gwt.user.client.ui.HTML;
5
import com.google.gwt.user.client.ui.HTML;
6
import com.google.gwt.user.client.ui.TextBox;
6
import com.google.gwt.user.client.ui.TextBox;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
public class FourCharactersFormValidator extends AbstractTextFieldValidator {
8
public class FourCharactersFormValidator extends AbstractTextFieldValidator {
9
 
9
 
10
	public FourCharactersFormValidator(TextBox textBox, HTML sideHTML) {
10
	public FourCharactersFormValidator(TextBox textBox) {
11
		super(textBox, sideHTML);
11
		super(textBox);
Line 12... Line 12...
12
		// TODO Auto-generated constructor stub
12
		// TODO Auto-generated constructor stub
13
	}
13
	}
14
 
14
 
15
	@Override
15
	@Override
16
	public boolean validate() {
16
	public boolean validate() {
17
		if(getTextBox().getText().length()>=4){
-
 
18
			getSideHTML().setHTML("");
17
		if(getTextBox().getText().length()>=4){
19
			return true;
18
			getTextBox().removeStyleName(getStyleErreur());
20
		}
19
			return true;
21
		else {
20
		} else {
22
			getSideHTML().setHTML("<font color='red'>"+I18n.getVocabulary().auMoins4charcateres()+"</font>");
21
			getTextBox().addStyleName(getStyleErreur());
Line 23... Line 22...
23
			return false;
22
			return false;