// TODO do not forget about Money later (after Money widget will be available)
private List<AbstractCriterionWidget> createCriteriaWidgets(final ICentreDomainTreeManagerAndEnhancer centre, final Class<? extends AbstractEntity<?>> root) {
        final Class<?> managedType = centre.getEnhancer().getManagedType(root);
        final List<AbstractCriterionWidget> criteriaWidgets = new ArrayList<>();
        for (final String critProp : centre.getFirstTick().checkedProperties(root)) {
            if (!AbstractDomainTree.isPlaceholder(critProp)) {
                final boolean isEntityItself = "".equals(critProp); // empty property means "entity itself"
                final Class<?> propertyType = isEntityItself ? managedType : PropertyTypeDeterminator.determinePropertyType(managedType, critProp);
                final AbstractCriterionWidget criterionWidget;
                if (AbstractDomainTree.isCritOnlySingle(managedType, critProp)) {
                    if (EntityUtils.isEntityType(propertyType)) {
                        final List<Pair<String, Boolean>> additionalProps = dslDefaultConfig.getAdditionalPropsForAutocompleter(critProp);
                        criterionWidget = new EntitySingleCriterionWidget(root, managedType, critProp, additionalProps, getCentreContextConfigFor(critProp));
                    } else if (EntityUtils.isString(propertyType)) {
                        criterionWidget = new StringSingleCriterionWidget(root, managedType, critProp);
                    } else if (EntityUtils.isBoolean(propertyType)) {
                        criterionWidget = new BooleanSingleCriterionWidget(root, managedType, critProp);
                    } else if (Integer.class.isAssignableFrom(propertyType) || Long.class.isAssignableFrom(propertyType)) {
                        criterionWidget = new IntegerSingleCriterionWidget(root, managedType, critProp);
                    } else if (BigDecimal.class.isAssignableFrom(propertyType)) {
                        criterionWidget = new DecimalSingleCriterionWidget(root, managedType, critProp);
                    } else if (Money.class.isAssignableFrom(propertyType)) {
                        criterionWidget = new MoneySingleCriterionWidget(root, managedType, critProp);
                    } else if (EntityUtils.isDate(propertyType)) {
                        criterionWidget = new DateSingleCriterionWidget(root, managedType, critProp);
                    } else {
                        throw new UnsupportedOperationException(String.format("The crit-only single editor type [%s] is currently unsupported.", propertyType));
                    }
                } else {
                    if (EntityUtils.isEntityType(propertyType)) {
                        final List<Pair<String, Boolean>> additionalProps = dslDefaultConfig.getAdditionalPropsForAutocompleter(critProp);
                        criterionWidget = new EntityCriterionWidget(root, managedType, critProp, additionalProps, getCentreContextConfigFor(critProp));
                    } else if (EntityUtils.isString(propertyType)) {
                        criterionWidget = new StringCriterionWidget(root, managedType, critProp);
                    } else if (EntityUtils.isBoolean(propertyType)) {
                        criterionWidget = new BooleanCriterionWidget(root, managedType, critProp);
                    } else if (Integer.class.isAssignableFrom(propertyType) || Long.class.isAssignableFrom(propertyType)) {
                        criterionWidget = new IntegerCriterionWidget(root, managedType, critProp);
                    } else if (BigDecimal.class.isAssignableFrom(propertyType)) { // TODO do not forget about Money later (after Money widget will be available)
                        criterionWidget = new DecimalCriterionWidget(root, managedType, critProp);
                    } else if (Money.class.isAssignableFrom(propertyType)) {
                        criterionWidget = new MoneyCriterionWidget(root, managedType, critProp);
                    } else if (EntityUtils.isDate(propertyType)) {
                        criterionWidget = new DateCriterionWidget(root, managedType, critProp);
                    } else {
                        throw new UnsupportedOperationException(String.format("The multi / range editor type [%s] is currently unsupported.", propertyType));
                    }
                }
                criteriaWidgets.add(criterionWidget);
            }
        }
        return criteriaWidgets;
    }
} else if (Integer.class.isAssignableFrom(propertyType) || Long.class.isAssignableFrom(propertyType)) {
criterionWidget = new IntegerCriterionWidget(root, managedType, critProp);
} else if (BigDecimal.class.isAssignableFrom(propertyType)) { // TODO do not forget about Money later (after Money widget will be available)
criterionWidget = new DecimalCriterionWidget(root, managedType, critProp);
} else if (Money.class.isAssignableFrom(propertyType)) {
} else {
if (EntityUtils.isEntityType(propertyType)) {
final List<Pair<String, Boolean>> additionalProps = dslDefaultConfig.getAdditionalPropsForAutocompleter(critProp);
criterionWidget = new EntityCriterionWidget(root, managedType, critProp, additionalProps, getCentreContextConfigFor(critProp));
} else if (EntityUtils.isString(propertyType)) {
criterionWidget = new StringCriterionWidget(root, managedType, critProp);
} else if (EntityUtils.isBoolean(propertyType)) {
criterionWidget = new BooleanCriterionWidget(root, managedType, critProp);
} else if (Integer.class.isAssignableFrom(propertyType) || Long.class.isAssignableFrom(propertyType)) {
criterionWidget = new IntegerCriterionWidget(root, managedType, critProp);
} else if (BigDecimal.class.isAssignableFrom(propertyType)) { // TODO do not forget about Money later (after Money widget will be available)
criterionWidget = new DecimalCriterionWidget(root, managedType, critProp);
} else if (Money.class.isAssignableFrom(propertyType)) {
criterionWidget = new MoneyCriterionWidget(root, managedType, critProp);
} else if (EntityUtils.isDate(propertyType)) {
criterionWidget = new DateCriterionWidget(root, managedType, critProp);
} else {
throw new UnsupportedOperationException(String.format("The multi / range editor type [%s] is currently unsupported.", propertyType));
}
}
criteriaWidgets.add(criterionWidget);
criterionWidget = new IntegerSingleCriterionWidget(root, managedType, critProp);
} else if (BigDecimal.class.isAssignableFrom(propertyType)) {
criterionWidget = new DecimalSingleCriterionWidget(root, managedType, critProp);
} else if (Money.class.isAssignableFrom(propertyType)) {
criterionWidget = new MoneySingleCriterionWidget(root, managedType, critProp);
} else if (EntityUtils.isDate(propertyType)) {
criterionWidget = new DateSingleCriterionWidget(root, managedType, critProp);
} else {
throw new UnsupportedOperationException(String.format("The crit-only single editor type [%s] is currently unsupported.", propertyType));
}
} else {
if (EntityUtils.isEntityType(propertyType)) {
final List<Pair<String, Boolean>> additionalProps = dslDefaultConfig.getAdditionalPropsForAutocompleter(critProp);
criterionWidget = new EntityCriterionWidget(root, managedType, critProp, additionalProps, getCentreContextConfigFor(critProp));
} else if (EntityUtils.isString(propertyType)) {
criterionWidget = new StringCriterionWidget(root, managedType, critProp);
} else if (EntityUtils.isBoolean(propertyType)) {
criterionWidget = new BooleanCriterionWidget(root, managedType, critProp);
} else if (Integer.class.isAssignableFrom(propertyType) || Long.class.isAssignableFrom(propertyType)) {
criterionWidget = new IntegerCriterionWidget(root, managedType, critProp);
} else if (BigDecimal.class.isAssignableFrom(propertyType)) { // TODO do not forget about Money later (after Money widget will be available)
criterionWidget = new DecimalCriterionWidget(root, managedType, critProp);
} else if (Money.class.isAssignableFrom(propertyType)) {
criterionWidget = new MoneyCriterionWidget(root, managedType, critProp);
} else if (EntityUtils.isDate(propertyType)) {
criterionWidget = new DateCriterionWidget(root, managedType, critProp);
} else {
throw new UnsupportedOperationException(String.format("The multi / range editor type [%s] is currently unsupported.", propertyType));
}
}
criteriaWidgets.add(criterionWidget);
}
}
return criteriaWidgets;
}