Subversion Repositories eFlore/Applications.del

Rev

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

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