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;
    }
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);
                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)) {
                        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;
    }
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); 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)) { 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; }