Search in sources :

Example 6 with HasComponents

use of com.vaadin.ui.HasComponents in project jmix by jmix-framework.

the class AbstractCanvasLayout method getWeight.

@Override
public int getWeight() {
    Layout unwrapThis = this.unwrap(Layout.class);
    HasComponents parent = unwrapThis.getParent();
    if (parent instanceof AbstractOrderedLayout) {
        int weight = (int) ((AbstractOrderedLayout) parent).getExpandRatio(unwrapThis);
        return weight > 0 ? weight : 1;
    } else {
        return 1;
    }
}
Also used : Layout(com.vaadin.ui.Layout) DashboardLayout(io.jmix.dashboards.model.visualmodel.DashboardLayout) CanvasLayout(io.jmix.dashboardsui.component.CanvasLayout) HBoxLayout(io.jmix.ui.component.HBoxLayout) AbstractOrderedLayout(com.vaadin.ui.AbstractOrderedLayout) JmixCssActionsLayout(io.jmix.ui.widget.JmixCssActionsLayout) HasComponents(com.vaadin.ui.HasComponents) AbstractOrderedLayout(com.vaadin.ui.AbstractOrderedLayout)

Aggregations

HasComponents (com.vaadin.ui.HasComponents)6 AbstractOrderedLayout (com.vaadin.ui.AbstractOrderedLayout)2 Component (com.vaadin.ui.Component)2 Layout (com.vaadin.ui.Layout)2 UI (com.vaadin.ui.UI)2 DashboardLayout (io.jmix.dashboards.model.visualmodel.DashboardLayout)2 CanvasLayout (io.jmix.dashboardsui.component.CanvasLayout)2 HBoxLayout (io.jmix.ui.component.HBoxLayout)2 JmixCssActionsLayout (io.jmix.ui.widget.JmixCssActionsLayout)2 AbstractComponent (com.vaadin.ui.AbstractComponent)1