Search in sources :

Example 1 with ExpandingLayout

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

the class DashboardModelConverter method initChildren.

private void initChildren(CanvasFragment fragment, DashboardLayout model, ComponentContainer delegate) {
    boolean expanded = isExpanded(model);
    if (!model.getChildren().isEmpty()) {
        for (DashboardLayout childModel : model.getChildren()) {
            CanvasLayout childContainer = modelToContainer(fragment, childModel);
            delegate.add(childContainer);
            if (childModel.getId().equals(model.getExpand())) {
                if (delegate instanceof ExpandingLayout) {
                    ((ExpandingLayout) delegate).expand(childContainer);
                }
            }
            if (!expanded) {
                childContainer.setWeight(childModel.getWeight());
            }
        }
    }
}
Also used : ExpandingLayout(io.jmix.ui.component.ExpandingLayout) CanvasLayout(io.jmix.dashboardsui.component.CanvasLayout)

Aggregations

CanvasLayout (io.jmix.dashboardsui.component.CanvasLayout)1 ExpandingLayout (io.jmix.ui.component.ExpandingLayout)1