Search in sources :

Example 1 with GroupBoxLayout

use of io.jmix.ui.component.GroupBoxLayout in project jmix by jmix-framework.

the class FilterDelegateImpl method createLayout.

@Override
public void createLayout() {
    if (layout == null) {
        groupBoxLayout = uiComponents.create(GroupBoxLayout.class);
        groupBoxLayout.addExpandedStateChangeListener(e -> fireExpandStateChange(e.isUserOriginated()));
        groupBoxLayout.setOrientation(GroupBoxLayout.Orientation.VERTICAL);
        groupBoxLayout.setWidthFull();
        layout = groupBoxLayout;
        layout.setSpacing(true);
        if (caption == null) {
            setCaption(getMainMessage("filter.groupBoxCaption"));
        }
    } else {
        Collection<Component> components = layout.getComponents();
        for (Component component : components) {
            layout.remove(component);
        }
    }
    appliedFiltersLayout = uiComponents.create(VBoxLayout.class);
    conditionsLayout = uiComponents.create(CssLayout.class);
    // initially hidden
    conditionsLayout.setVisible(false);
    conditionsLayout.setWidthFull();
    conditionsLayout.setStyleName("filter-conditions");
    if (filterMode == FilterMode.GENERIC_MODE) {
        createControlsLayoutForGeneric();
    } else {
        createControlsLayoutForFts();
    }
    if (CONDITIONS_LOCATION_TOP.equals(conditionsLocation)) {
        layout.add(conditionsLayout);
        layout.add(controlsLayout);
    } else {
        layout.add(controlsLayout);
        layout.add(conditionsLayout);
    }
}
Also used : VBoxLayout(io.jmix.ui.component.VBoxLayout) CssLayout(io.jmix.ui.component.CssLayout) GroupBoxLayout(io.jmix.ui.component.GroupBoxLayout) ListComponent(com.haulmont.cuba.gui.components.ListComponent) Component(io.jmix.ui.component.Component)

Example 2 with GroupBoxLayout

use of io.jmix.ui.component.GroupBoxLayout in project jmix by jmix-framework.

the class FilterDelegateImpl method createGroupConditionBox.

protected Component createGroupConditionBox(AbstractCondition condition, Node<AbstractCondition> node, ConditionsFocusType conditionsFocusType, boolean focusSet, int level) {
    Component groupCellContent;
    GroupBoxLayout groupBox = uiComponents.create(GroupBoxLayout.class);
    groupBox.setStyleName("conditions-group");
    groupBox.setWidth("100%");
    groupBox.setCaption(condition.getLocCaption());
    if (!node.getChildren().isEmpty()) {
        recursivelyCreateConditionsLayout(conditionsFocusType, focusSet, node.getChildren(), groupBox, level);
    }
    groupCellContent = groupBox;
    return groupCellContent;
}
Also used : GroupBoxLayout(io.jmix.ui.component.GroupBoxLayout) ListComponent(com.haulmont.cuba.gui.components.ListComponent) Component(io.jmix.ui.component.Component)

Aggregations

ListComponent (com.haulmont.cuba.gui.components.ListComponent)2 Component (io.jmix.ui.component.Component)2 GroupBoxLayout (io.jmix.ui.component.GroupBoxLayout)2 CssLayout (io.jmix.ui.component.CssLayout)1 VBoxLayout (io.jmix.ui.component.VBoxLayout)1