use of org.eclipse.scout.rt.shared.data.form.IPropertyHolder in project scout.rt by eclipse.
the class AbstractForm method importProperties.
private void importProperties(IPropertyHolder source, Object target, Class<?> stopClass, IPropertyFilter filter) {
// local properties
Map<String, Object> properties = BeanUtility.getProperties(source, stopClass, filter);
if (!properties.isEmpty()) {
removeNotSetProperties(source, properties);
BeanUtility.setProperties(target, properties, false, null);
}
// properties of the extensions
List<Object> allContributions = source.getAllContributions();
if (!allContributions.isEmpty()) {
for (Object con : allContributions) {
if (con instanceof IPropertyHolder) {
IPropertyHolder data = (IPropertyHolder) con;
Map<String, Object> extensionProperties = BeanUtility.getProperties(data, stopClass, filter);
if (!extensionProperties.isEmpty()) {
Object clientPart = getClientPartOfExtensionOrContributionRec(data, target);
if (clientPart != null) {
removeNotSetProperties(data, extensionProperties);
BeanUtility.setProperties(clientPart, extensionProperties, false, null);
} else {
LOG.warn("cannot find extension for property data '{}' in form '{}'.", data.getClass().getName(), this.getClass().getName());
}
}
}
}
}
}
Aggregations