com.holonplatform.vaadin7.components.builders

## Interface GridLayoutBuilder

- All Superinterfaces:
    BaseLayoutBuilder<com.vaadin.ui.GridLayout,GridLayoutBuilder>, ClickableLayoutConfigurator<GridLayoutBuilder>, ComponentBuilder<com.vaadin.ui.GridLayout,GridLayoutBuilder>, ComponentConfigurator<GridLayoutBuilder>, ComponentContainerBuilder<com.vaadin.ui.GridLayout,GridLayoutBuilder>, ComponentContainerConfigurator<GridLayoutBuilder>, LayoutBuilder<com.vaadin.ui.GridLayout,GridLayoutBuilder>, LayoutConfigurator<GridLayoutBuilder>

      public interface GridLayoutBuilder
      extends LayoutBuilder<com.vaadin.ui.GridLayout,GridLayoutBuilder>

  Builder to create `GridLayout` instances.
  Since:
    5.0.0

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.holonplatform.vaadin7.components.builders.LayoutConfigurator

      `LayoutConfigurator.BaseLayoutConfigurator`

    - ### Nested classes/interfaces inherited from interface com.holonplatform.vaadin7.components.builders.ClickableLayoutConfigurator

      `ClickableLayoutConfigurator.BaseClickableLayoutConfigurator`

    - ### Nested classes/interfaces inherited from interface com.holonplatform.vaadin7.components.builders.ComponentConfigurator

      `ComponentConfigurator.BaseComponentConfigurator`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `GridLayoutBuilder` | `add(com.vaadin.ui.Component component, int column, int row)` Adds the component to the grid in cells column1,row1 (NortWest corner of the area.)
    `GridLayoutBuilder` | `add(com.vaadin.ui.Component component, int column1, int row1, int column2, int row2)` Adds a component to the grid in the specified area.
    `GridLayoutBuilder` | `columnExpandRatio(int columnIndex, float ratio)` Sets the expand ratio of given column.
    `GridLayoutBuilder` | `columns(int columns)` Set the number of columns of the grid
    `GridLayoutBuilder` | `hideEmptyRowsAndColumns()` Empty rows and columns will be considered as non-existent when rendering the grid, i.e. the spacing between multiple empty columns (or rows) will be collapsed.
    `GridLayoutBuilder` | `newLine()` Forces the next component to be added at the beginning of the next line.
    `GridLayoutBuilder` | `rowExpandRatio(int rowIndex, float ratio)` Sets the expand ratio of given row.
    `GridLayoutBuilder` | `rows(int rows)` Set the number of rows of the grid
    `GridLayoutBuilder` | `skip()` Moves the cursor forward by one.

    - ### Methods inherited from interface com.holonplatform.vaadin7.components.builders.LayoutConfigurator

      `addAndAlign, align, defaultAlignment, margin, marginBottom, marginLeft, marginRight, marginTop, spacing`

    - ### Methods inherited from interface com.holonplatform.vaadin7.components.builders.ClickableLayoutConfigurator

      `withLayoutClickListener`

    - ### Methods inherited from interface com.holonplatform.vaadin7.components.builders.BaseLayoutBuilder

      `withLayoutClickListener`

    - ### Methods inherited from interface com.holonplatform.vaadin7.components.builders.ComponentContainerConfigurator

      `add, withComponentAttachListener, withComponentDetachListener`

    - ### Methods inherited from interface com.holonplatform.vaadin7.components.builders.ComponentBuilder

      `build, deferLocalization`

    - ### Methods inherited from interface com.holonplatform.vaadin7.components.builders.ComponentConfigurator

      `caption, caption, caption, captionAsHtml, description, description, description, disabled, errorHandler, fullHeight, fullSize, fullWidth, height, height, heightUndefined, hidden, icon, id, immediate, notVisible, primaryStyleName, replaceStyleName, responsive, sizeUndefined, styleName, width, width, widthUndefined, withAttachListener, withContextClickListener, withData, withDetachListener, withShortcutListener`

- - ### Method Detail

    - #### columns

          GridLayoutBuilder columns(int columns)

      Set the number of columns of the grid
      Parameters:
        `columns` - Number of columns
      Returns:
        this

    - #### rows

          GridLayoutBuilder rows(int rows)

      Set the number of rows of the grid
      Parameters:
        `rows` - Number of rows
      Returns:
        this

    - #### add

          GridLayoutBuilder add(com.vaadin.ui.Component component,
                                int column,
                                int row)

      Adds the component to the grid in cells column1,row1 (NortWest corner of the area.) End coordinates (SouthEast corner of the area) are the same as column1,row1. The coordinates are zero-based. Component width and height is 1.
      Parameters:
        `component` - the component to be added, not `null`
        `column` - the column index, starting from 0.
        `row` - the row index, starting from 0.
      Returns:
        this

    - #### add

          GridLayoutBuilder add(com.vaadin.ui.Component component,
                                int column1,
                                int row1,
                                int column2,
                                int row2)

      Adds a component to the grid in the specified area. The area is defined by specifying the upper left corner (column1, row1) and the lower right corner (column2, row2) of the area. The coordinates are zero-based.

      If the area overlaps with any of the existing components already present in the grid, the operation will fail and an `GridLayout.OverlapsException` is thrown.

      Parameters:
        `component` - the component to be added, not `null`.
        `column1` - the column of the upper left corner of the area `component` is supposed to occupy. The leftmost column has index 0.
        `row1` - the row of the upper left corner of the area `c` is supposed to occupy. The topmost row has index 0.
        `column2` - the column of the lower right corner of the area `component` is supposed to occupy.
        `row2` - the row of the lower right corner of the area `component` is supposed to occupy.
      Returns:
        this

    - #### newLine

          GridLayoutBuilder newLine()

      Forces the next component to be added at the beginning of the next line.

      Sets the cursor column to 0 and increments the cursor row by one.

      Returns:
        this

    - #### skip

          GridLayoutBuilder skip()

      Moves the cursor forward by one. If the cursor goes out of the right grid border, it is moved to the first column of the next row.
      Returns:
        this

    - #### columnExpandRatio

          GridLayoutBuilder columnExpandRatio(int columnIndex,
                                              float ratio)

      Sets the expand ratio of given column.

      The expand ratio defines how excess space is distributed among columns. Excess space means space that is left over from components that are not sized relatively. By default, the excess space is distributed evenly.

      Note, that width of this GridLayout needs to be defined (fixed or relative, as opposed to undefined height) for this method to have any effect.

      Note that checking for relative width for the child components is done on the server so you cannot set a child component to have undefined width on the server and set it to `100%` in CSS. You must set it to `100%` on the server.

      Parameters:
        `columnIndex` - Index of the column to expand
        `ratio` - Expand ratio
      Returns:
        this

    - #### rowExpandRatio

          GridLayoutBuilder rowExpandRatio(int rowIndex,
                                           float ratio)

      Sets the expand ratio of given row.

      Expand ratio defines how excess space is distributed among rows. Excess space means the space left over from components that are not sized relatively. By default, the excess space is distributed evenly.

      Note, that height of this GridLayout needs to be defined (fixed or relative, as opposed to undefined height) for this method to have any effect.

      Note that checking for relative height for the child components is done on the server so you cannot set a child component to have undefined height on the server and set it to `100%` in CSS. You must set it to `100%` on the server.

      Parameters:
        `rowIndex` - Index of the row to expand
        `ratio` - Expand ratio
      Returns:
        this

    - #### hideEmptyRowsAndColumns

          GridLayoutBuilder hideEmptyRowsAndColumns()

      Empty rows and columns will be considered as non-existent when rendering the grid, i.e. the spacing between multiple empty columns (or rows) will be collapsed.
      Returns:
        this

Copyright © 2019 The Holon Platform. All rights reserved.