How to format a DateField in an editable Table?

I’m trying to figure out how to format a DateField in an editable table to display the date as ‘yyyy-MM-dd’.

In a non-editable table, I can subclass Table and override formatPropertyValue with the necessary code, such as:

	protected String formatPropertyValue(Object rowId, Object colId, Property property) {

        Object v = property.getValue();
        if (v instanceof Date) {
            return new SimpleDateFormat("yyyy-MM-dd").format(v);
        	return super.formatPropertyValue(rowId, colId, property);

But when the table is marked as editable, it no longer calls formatPropertyValue. Instead, I’ve noticed it calls fieldFactory.createField. So I’ve tried to set the TableFieldFactory as follows:

	dataTable.setTableFieldFactory(new DefaultFieldFactory() {
				public Field createField(Container container, Object itemId, Object propertyId, com.vaadin.ui.Component uiContext) {
	                // Create fields by their class
	                Class<?> cls = container.getType(propertyId);

	                // Create a DateField with year resolution for dates
	                if (Date.class.isAssignableFrom(cls)) {
	                    DateField df = new DateField();
	                    df.setPropertyDataSource(new PropertyFormatter() {
							public Object parse(String formattedValue) throws Exception {
								return DateUtils.parseDate(formattedValue, "yyyy-MM-dd");
							public String format(Object value) {
								if( Date.class.isAssignableFrom(value.getClass()))
									return new SimpleDateFormat( "yyyy-MM-dd").format((Date)value);
									return "????";
	                    return df;

	                // Otherwise use the default field factory 
	                return super.createField(container, itemId, propertyId, uiContext);

However, when I do that, I get the following error:

 [java.lang.IllegalArgumentException: DateField only supports Date properties]
 with root cause
java.lang.IllegalArgumentException: DateField only supports Date properties
	at com.vaadin.ui.DateField.setPropertyDataSource(
	at com.ia.vaadin.TabbedWindow$1.createField(
	at com.vaadin.ui.Table.getPropertyValue(
	at com.vaadin.ui.Table.getVisibleCellsNoCache(

So I’m a little confused. If I also subclass getType() to return Date.class, then I have to modify getValue() to return a Date object. But I don’t know how where to get value to return. Additionally, according to the API, getValue() is supposed to return the formatted value, which a Date object is not.

So either I am barking up the wrong tree, or I am a little lost as to how to properly create my PropertyFormatter. The Book of Vaadin pretty much says it is too complicated to explain so it is left up to the reader to figure out on his own.

Can anyone help please?