com.vaadin.client.widgets.

Class Grid.StaticSection<ROWTYPE extends Grid.StaticSection.StaticRow<?>>

  • Type Parameters:

    ROWTYPE - the type of the rows in the section

    Direct Known Subclasses:

    Grid.Footer, Grid.Header

    Enclosing class:

    Grid<T>

    public abstract static class Grid.StaticSection<ROWTYPE extends Grid.StaticSection.StaticRow<?>>
    extends Object

    Abstract base class for Grid header and footer sections.

    Since:

    7.5.0

    • Constructor Detail

      • StaticSection

        public StaticSection()
    • Method Detail

      • createRow

        protected abstract ROWTYPE createRow()

        Creates and returns a new instance of the row type.

        Returns:

        the created row

      • requestSectionRefresh

        protected abstract void requestSectionRefresh()

        Informs the grid that this section should be re-rendered.

        Note that re-render means calling update() on each cell, preAttach()/postAttach()/preDetach()/postDetach() is not called as the cells are not removed from the DOM.

      • setVisible

        public void setVisible​(boolean visible)

        Sets the visibility of the whole section.

        Parameters:

        visible - true to show this section, false to hide

      • isVisible

        public boolean isVisible()

        Returns the visibility of this section.

        Returns:

        true if visible, false otherwise.

      • getRow

        public ROWTYPE getRow​(int index)

        Returns the row at the given position.

        Parameters:

        index - the position of the row

        Returns:

        the row with the given index

        Throws:

        IndexOutOfBoundsException - if the index is out of bounds

      • getRowCount

        public int getRowCount()

        Returns the number of rows in this section.

        Returns:

        the number of rows

      • getRows

        protected List<ROWTYPE> getRows()

        Returns the current list of rows within this section.

        Returns:

        list of rows

      • getVisibleRowCount

        protected int getVisibleRowCount()

        Returns how many visible rows there are within this section (all or nothing, visibility cannot be set on the row level).

        Returns:

        amount of visible rows

      • addColumn

        protected void addColumn​(Grid.Column<?,​?> column)

        Adds cells for the given column to all the rows within this section.

        Parameters:

        column - the column that requires cells

      • removeColumn

        protected void removeColumn​(Grid.Column<?,​?> column)

        Removes cells for the given column from all the rows within this section.

        Parameters:

        column - the column that should have its cells removed

      • setGrid

        protected void setGrid​(Grid<?> grid)

        Sets the grid this section belongs to. Should not be null.

        Parameters:

        grid - the parent grid

      • getGrid

        protected Grid<?> getGrid()

        Returns the grid this section belongs to.

        Returns:

        the parent grid

      • updateColSpans

        protected void updateColSpans()

        Triggers column span calculation for all the rows within this section that contain spanned cells.