Subversion Repositories eFlore/Applications.del

Rev

Rev 210 | 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
 
8
 
228 aurelien 9
public class ValidateurChampDouble extends ValidateurChampTexteAbstrait {
101 benjamin 10
 
228 aurelien 11
	public ValidateurChampDouble(TextBox textBox) {
109 aurelien 12
		super(textBox);
101 benjamin 13
	}
14
 
15
	@Override
228 aurelien 16
	public boolean valider() {
101 benjamin 17
		try {
18
			Double.parseDouble(getTextBox().getText());
109 aurelien 19
			getTextBox().removeStyleName(getStyleErreur());
101 benjamin 20
			return true;
21
		} catch (Exception e) {
109 aurelien 22
			getTextBox().addStyleName(getStyleErreur());
101 benjamin 23
			return false;
24
		}
25
	}
26
 
27
}