2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.propertysheet
;
12 import org
.eclipse
.jface
.viewers
.ICellEditorValidator
;
19 public class DayValidator
implements ICellEditorValidator
{
22 * @see org.eclipse.jface.viewers.ICellEditorValidator#isValid(java.lang.Object)
25 public String
isValid(Object value
) {
27 String msg
= "Value in day field must be an integer between 1-31.";
29 if (((String
) value
).equals("")) {
35 day
= new Integer((String
) value
);
36 } catch (ClassCastException e
) {
38 } catch (NumberFormatException e
) {
42 if (day
== 0 || day
> 31) {