Subversion Repositories eFlore/Applications.del

Rev

Rev 101 | Go to most recent revision | 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 NumericFormValidator extends AbstractTextFieldValidator {
8
public class NumericFormValidator extends AbstractTextFieldValidator {
9
 
9
 
10
	public NumericFormValidator(TextBox textBox, HTML sideHTML) {
10
	public NumericFormValidator(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
		try{
16
		try{
17
			Integer.parseInt(getTextBox().getText());
-
 
18
			getSideHTML().setHTML("");
17
			Integer.parseInt(getTextBox().getText());
19
			return true;
18
			getTextBox().removeStyleName(getStyleErreur());
20
		}
19
			return true;
21
		catch (Exception e) {
20
		} catch (Exception e) {
22
			getSideHTML().setHTML("<font color='red'>"+I18n.getVocabulary().valeurNonNumerique()+"</font>");
21
			getTextBox().addStyleName(getStyleErreur());