use of io.jmix.ui.entity.GroupFilterCondition in project jmix by jmix-framework.
the class GroupFilterConverter method convertToModel.
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public GroupFilterCondition convertToModel(GroupFilter groupFilter) {
GroupFilterCondition groupFilterCondition = super.convertToModel(groupFilter);
groupFilterCondition.setOperation(groupFilter.getOperation());
groupFilterCondition.setCaption(groupFilter.getCaption());
groupFilterCondition.setLocalizedCaption(getLocalizedModelCaption(groupFilter));
groupFilterCondition.setOperationCaptionVisible(groupFilter.isOperationCaptionVisible());
List<FilterCondition> ownFilterConditions = new ArrayList<>();
for (FilterComponent ownFilterComponent : groupFilter.getOwnFilterComponents()) {
FilterConverter ownFilterConverter = filterComponents.getConverterByComponentClass(ownFilterComponent.getClass(), filter);
FilterCondition ownFilterCondition = ownFilterConverter.convertToModel(ownFilterComponent);
ownFilterCondition.setParent(groupFilterCondition);
ownFilterConditions.add(ownFilterCondition);
}
if (!ownFilterConditions.isEmpty()) {
groupFilterCondition.setOwnFilterConditions(ownFilterConditions);
}
return groupFilterCondition;
}
use of io.jmix.ui.entity.GroupFilterCondition in project jmix by jmix-framework.
the class GroupFilterConverter method convertToComponent.
@Override
public GroupFilter convertToComponent(GroupFilterCondition model) {
GroupFilter groupFilter = super.convertToComponent(model);
groupFilter.setOperation(model.getOperation());
groupFilter.setCaption(model.getCaption());
groupFilter.setOperationCaptionVisible(model.getOperationCaptionVisible());
if (model.getOwnFilterConditions() != null) {
for (FilterCondition ownFilterCondition : model.getOwnFilterConditions()) {
FilterConverter ownFilterConverter = filterComponents.getConverterByModelClass(ownFilterCondition.getClass(), filter);
groupFilter.add(ownFilterConverter.convertToComponent(ownFilterCondition));
}
}
return groupFilter;
}
Aggregations