use of com.haulmont.cuba.gui.components.filter.descriptor.GroupConditionDescriptor in project cuba by cuba-platform.
the class FilterEditor method addGroup.
protected void addGroup(GroupType groupType) {
GroupConditionDescriptor conditionDescriptor = new GroupConditionDescriptor(groupType, filter.getId(), filter.getDatasource());
AbstractCondition condition = conditionDescriptor.createCondition();
AbstractCondition selectedCondition = conditionsDs.getItem();
Node<AbstractCondition> newNode = new Node<>(condition);
if (selectedCondition != null && selectedCondition instanceof GroupCondition) {
Node<AbstractCondition> node = conditions.getNode(selectedCondition);
if (node != null) {
node.addChild(newNode);
conditionsTree.expand(selectedCondition.getId());
}
} else {
conditions.getRootNodes().add(newNode);
}
refreshConditionsDs();
conditionsTree.setSelected(condition);
}
Aggregations