/** * Adds empty containers to grid row. If not to complete the row with gaps then in case of grid with one element (element width = 1) * this element will occupy 100% of grid width, but expected behaviour is to occupy 1/3 of grid width */ protected void completeGridRowWithGaps(GridLayout grid, int row, int startColumn, boolean lastRow) { for (int i = startColumn * 2; i < grid.getColumns(); i++) { Component gap = uiComponents.create(Label.class); gap.setWidthFull(); grid.add(gap, i, row); } }
@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(); } }
columnComponent.setWidthFull();