Example usage for com.vaadin.ui GridLayout setColumnExpandRatio

List of usage examples for com.vaadin.ui GridLayout setColumnExpandRatio

Introduction

In this page you can find the example usage for com.vaadin.ui GridLayout setColumnExpandRatio.

Prototype

public void setColumnExpandRatio(int columnIndex, float ratio) 

Source Link

Document

Sets the expand ratio of given column.

Usage

From source file:uk.q3c.krail.testapp.view.ViewBaseGrid.java

License:Apache License

@Override
public void doBuild() {
    GridLayout grid = new GridLayout(3, 4);
    Panel topMarginPanel = new Panel();
    topMarginPanel.setHeight(topMargin + "px");
    topMarginPanel.setWidth("100%");

    grid.setSizeFull();/*from   www .j a v  a2  s  . c  o  m*/
    grid.setColumnExpandRatio(0, 0.400f);
    grid.setColumnExpandRatio(1, 0.20f);
    grid.setColumnExpandRatio(2, 0.40f);

    grid.setRowExpandRatio(1, 0.40f);
    grid.setRowExpandRatio(2, 0.20f);
    grid.setRowExpandRatio(3, 0.40f);
    setRootComponent(grid);
}

From source file:uk.q3c.krail.testapp.view.WidgetsetView.java

License:Apache License

@Override
public void doBuild() {
    buttonPanel = new Panel();
    VerticalLayout verticalLayout = new VerticalLayout();
    buttonPanel.setContent(verticalLayout);

    setRootComponent(new GridLayout(3, 4));

    GridLayout grid = getGrid();

    grid.addComponent(buttonPanel, 1, 2);
    grid.setSizeFull();/* w w w .  j  a v a  2 s  .c  o m*/
    grid.setColumnExpandRatio(0, 0.400f);
    grid.setColumnExpandRatio(1, 0.20f);
    grid.setColumnExpandRatio(2, 0.40f);

    grid.setRowExpandRatio(0, 0.05f);
    grid.setRowExpandRatio(1, 0.15f);
    grid.setRowExpandRatio(2, 0.4f);
    grid.setRowExpandRatio(3, 0.15f);

    spinner = new Spinner(SpinnerType.FOLDING_CUBE).large();
    verticalLayout.addComponent(spinner);

    changeSpinnerType = new Button("Change Spinner Type");
    changeSpinnerType.addClickListener(e -> spinner.setType(SpinnerType.WAVE));
    verticalLayout.addComponent(changeSpinnerType);

    stepper = new IntStepper("Stepper");
    stepper.setValue(5);
    verticalLayout.addComponent(stepper);

    infoArea = new Label();
    infoArea.setContentMode(ContentMode.HTML);
    infoArea.setSizeFull();
    infoArea.setValue("These components are used purely to ensure that the Widgetset has compiled and included "
            + "add-ons");
    grid.addComponent(infoArea, 0, 1, 1, 1);

    param1 = new Label();
    param2 = new Label();
    VerticalLayout parameters = new VerticalLayout(param1, param2);
    grid.addComponent(parameters, 0, 2, 0, 2);
}