I would like to centralize making all columns of a given type to be handled in a specific way. Currently it's allowed to set values for specific properties, only.
in AbstractAutoGeneratedCrudFormFactory:
protected HasValueAndElement buildField(CrudFormConfiguration configuration, String property, Class<?> propertyType, T domainObject) throws InstantiationException, IllegalAccessException {
HasValueAndElement<?, ?> field;
FieldProvider<?, T> provider = (FieldProvider<?, T>) configuration.getFieldProviders().get(property);
if (provider != null) {
field = provider.buildField(domainObject);
} else {
Class<? extends HasValueAndElement<?, ?>> fieldType = configuration.getFieldTypes().get(property);
if (fieldType != null) {
field = fieldType.newInstance();
} else {
field = new DefaultFieldProvider(propertyType).buildField(domainObject);
}
}
it would be great if it was possible to override
field = new DefaultFieldProvider(propertyType).buildField(domainObject);
by changing
new DefaultFieldProvider(propertyType) to a new method getFieldProvider(propertyType) and make it overridable.
Or, is there any other better way to achieve this?
I would like to centralize making all columns of a given type to be handled in a specific way. Currently it's allowed to set values for specific properties, only.
in AbstractAutoGeneratedCrudFormFactory:
it would be great if it was possible to override
by changing
new DefaultFieldProvider(propertyType)
to a new methodgetFieldProvider(propertyType)
and make it overridable.Or, is there any other better way to achieve this?
(Initially reported by mistake in https://github.com/vaadin/directory/issues/47)