/** * @deprecated This method currently has no effect as expand ratios are not * implemented in FormLayout */ @Override @Deprecated public float getExpandRatio(Component component) { return super.getExpandRatio(component); }
} else if (newLocation == -1) { Alignment alignment = getComponentAlignment(oldComponent); float expandRatio = getExpandRatio(oldComponent);
float expandRatio = getExpandRatio(child); if (expandRatio == 1.0f) { childElement.attr(":expand", true);
@Override public float getExpandRatio(Component component) { com.vaadin.ui.Component vComponent = component.unwrap(com.vaadin.ui.Component.class); return this.component.getExpandRatio(vComponent); } }
@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; } }
public static boolean isComponentExpanded(com.haulmont.cuba.gui.components.Component component) { Component vComponent = WebComponentsHelper.getComposition(component); if (vComponent.getParent() instanceof AbstractOrderedLayout) { AbstractOrderedLayout layout = (AbstractOrderedLayout) vComponent.getParent(); return (int)layout.getExpandRatio(vComponent) == 1; } return false; }
@Override public void setWeight(int weight) { Layout unwrapThis = this.unwrap(Layout.class); HasComponents parent = unwrapThis.getParent(); if (parent instanceof AbstractOrderedLayout) { for (com.vaadin.ui.Component child : parent) { if (unwrapThis.equals(child)) { ((AbstractOrderedLayout) parent).setExpandRatio(unwrapThis, weight); } else if (((AbstractOrderedLayout) parent).getExpandRatio(child) == 0) { ((AbstractOrderedLayout) parent).setExpandRatio(child, 1); } } } }