/** * @deprecated This method currently has no effect as expand ratios are not * implemented in FormLayout */ @Override @Deprecated public void setExpandRatio(Component component, float ratio) { super.setExpandRatio(component, ratio); }
private void applyLayoutSettings(Component target, Alignment alignment, float expandRatio) { setComponentAlignment(target, alignment); setExpandRatio(target, expandRatio); }
@Override public void readDesign(Element design, DesignContext designContext) { // process default attributes super.readDesign(design, designContext); setMargin(readMargin(design, getMargin(), designContext)); // handle children for (Element childComponent : design.children()) { Attributes attr = childComponent.attributes(); Component newChild = designContext.readDesign(childComponent); addComponent(newChild); // handle alignment setComponentAlignment(newChild, DesignAttributeHandler.readAlignment(attr)); // handle expand ratio if (attr.hasKey(":expand")) { String value = attr.get(":expand"); if (!value.isEmpty()) { try { float ratio = Float.valueOf(value); setExpandRatio(newChild, ratio); } catch (NumberFormatException nfe) { getLogger() .info("Failed to parse expand ratio " + value); } } else { setExpandRatio(newChild, 1.0f); } } } }
@Override public void resetExpanded() { for (com.vaadin.ui.Component child : component) { component.setExpandRatio(child, 0); } }
@Override public void resetExpanded() { if (getContainer() instanceof AbstractOrderedLayout) { AbstractOrderedLayout container = (AbstractOrderedLayout) getContainer(); for (com.vaadin.ui.Component child : container) { container.setExpandRatio(child, 0.0f); } } else { throw new UnsupportedOperationException(); } }
/** * Set expand-ratio of detail-component */ public void setDetailExpandRatio(Component component, float ratio) { if(mainPanel.getContent() instanceof AbstractOrderedLayout) { ((AbstractOrderedLayout) mainPanel.getContent()).setExpandRatio(component, ratio); } else { throw new UnsupportedOperationException("Cannot set ExpandRatio, detail content is not AbstractOrderedLayout"); } }
public static void expand(AbstractOrderedLayout layout, Component component, String height, String width) { if (!isHorizontalLayout(layout) && (StringUtils.isEmpty(height) || AUTO_SIZE.equals(height) || height.endsWith("%"))) { component.setHeight(100, Sizeable.Unit.PERCENTAGE); } if (!isVerticalLayout(layout) && (StringUtils.isEmpty(width) || AUTO_SIZE.equals(width) || width.endsWith("%"))) { component.setWidth(100, Sizeable.Unit.PERCENTAGE); } layout.setExpandRatio(component, 1); }
@Override public com.holonplatform.vaadin7.components.builders.OrderedLayoutConfigurator.BaseOrderedLayoutConfigurator expand( Component component, float expandRatio) { getInstance().setExpandRatio(component, expandRatio); return builder(); }
private void processOrderedLayout(HasWidgetsElement hwe, AbstractLayout al) { for (WidgetElement we : hwe.getWidgets()) { Component widget = processWidgetElement(hwe, we, al); if (widget != null && al instanceof AbstractOrderedLayout) { AbstractOrderedLayout aol = (AbstractOrderedLayout) al; aol.setExpandRatio(widget, 1f); } } }
@Override public void resetExpanded() { for (com.vaadin.ui.Component child : getComponentContent()) { getComponentContent().setExpandRatio(child, 0.0f); } }
@Override public B expand(Component component, float expandRatio) { getInstance().setExpandRatio(component, expandRatio); return builder(); }
@Override public void setExpandRatio(Component component, float ratio) { if (ratio < 0) { throw new GuiDevelopmentException( String.format("Expand ratio must be greater than or equal to 0 in component: %s.", component.getId()), getFrame().getId()); } com.vaadin.ui.Component vComponent = component.unwrapComposition(com.vaadin.ui.Component.class); this.component.setExpandRatio(vComponent, ratio); }
@Override public com.holonplatform.vaadin7.components.builders.OrderedLayoutConfigurator.BaseOrderedLayoutConfigurator addAndExpand( Component component, float expandRatio) { getInstance().addComponent(component); getInstance().setExpandRatio(component, expandRatio); return builder(); }
@Override public B addAndExpand(Component component, float expandRatio) { getInstance().addComponent(component); getInstance().setExpandRatio(component, expandRatio); return builder(); }
@Override public B addAndExpand(Component component, float expandRatio) { getInstance().addComponent(component); getInstance().setExpandRatio(component, expandRatio); return builder(); }
@Override public void expand(Component childComponent) { component.setExpandRatio(childComponent.unwrapComposition(com.vaadin.ui.Component.class), 1); if (getExpandDirection() == ExpandDirection.VERTICAL) { childComponent.setHeightFull(); } else { childComponent.setWidthFull(); } }
@Override public B addAlignAndExpand(Component component, Alignment alignment, float expandRatio) { getInstance().addComponent(component); getInstance().setComponentAlignment(component, alignment); getInstance().setExpandRatio(component, expandRatio); return builder(); }
@Override public com.holonplatform.vaadin.components.builders.OrderedLayoutConfigurator.BaseOrderedLayoutConfigurator addAlignAndExpand( Component component, Alignment alignment, float expandRatio) { getInstance().addComponent(component); getInstance().setComponentAlignment(component, alignment); getInstance().setExpandRatio(component, expandRatio); return builder(); }
@Override public B addAlignAndExpand(Component component, Alignment alignment, float expandRatio) { getInstance().addComponent(component); getInstance().setComponentAlignment(component, alignment); getInstance().setExpandRatio(component, expandRatio); return builder(); }
@Override public com.holonplatform.vaadin7.components.builders.OrderedLayoutConfigurator.BaseOrderedLayoutConfigurator addAlignAndExpand( Component component, Alignment alignment, float expandRatio) { getInstance().addComponent(component); getInstance().setComponentAlignment(component, alignment); getInstance().setExpandRatio(component, expandRatio); return builder(); }