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 6... Line 6...
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
 
8
 
9
public class DoubleFormValidator extends AbstractTextFieldValidator {
9
public class DoubleFormValidator extends AbstractTextFieldValidator {
10
 
10
 
Line 11... Line 11...
11
	public DoubleFormValidator(TextBox textBox, HTML sideHTML) {
11
	public DoubleFormValidator(TextBox textBox) {
12
		super(textBox, sideHTML);
12
		super(textBox);
13
	}
13
	}
14
 
14
 
15
	@Override
15
	@Override
16
	public boolean validate() {
16
	public boolean validate() {
17
		try {
17
		try {
18
			Double.parseDouble(getTextBox().getText());
18
			Double.parseDouble(getTextBox().getText());
19
			getSideHTML().setHTML("");
19
			getTextBox().removeStyleName(getStyleErreur());
20
			return true;
20
			return true;
21
		} catch (Exception e) {
21
		} catch (Exception e) {
Line 22... Line 22...
22
			getSideHTML().setHTML("<font color='red'>" + I18n.getVocabulary().valeurNonNumerique() + "</font>");
22
			getTextBox().addStyleName(getStyleErreur());