com.vaadin.ui.components.grid.

Class StaticSection.StaticRow<CELL extends com.vaadin.ui.components.grid.StaticSection.StaticCell>

    • Constructor Detail

      • StaticRow

        protected StaticRow​(StaticSection<?> section)

        Creates a new row belonging to the given section.

        Parameters:

        section - the section of the row

    • Method Detail

      • createCell

        protected abstract CELL createCell()

        Creates and returns a new instance of the cell type.

        Returns:

        the created cell

      • getCellTagName

        protected abstract String getCellTagName()

        Returns the declarative tag name used for the cells in this row.

        Returns:

        the cell tag name

      • addCell

        protected void addCell​(String columnId)

        Adds a cell to this section, corresponding to the given user-defined column id.

        Parameters:

        columnId - the id of the column for which to add a cell

      • addCell

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

        Adds a cell to this section for given column.

        Parameters:

        column - the column for which to add a cell

      • internalAddCell

        protected void internalAddCell​(String internalId)

        Adds a cell to this section, corresponding to the given internal column id.

        Parameters:

        internalId - the internal id of the column for which to add a cell

      • removeCell

        protected void removeCell​(String columnId)

        Removes the cell from this section that corresponds to the given column id. If there is no such cell, does nothing.

        Parameters:

        columnId - the id of the column from which to remove the cell

      • getRowState

        protected SectionState.RowState getRowState()

        Returns the shared state of this row.

        Returns:

        the row state

      • getCell

        public CELL getCell​(String columnId)

        Returns the cell in this section that corresponds to the given column id.

        Parameters:

        columnId - the id of the column

        Returns:

        the cell for the given column

        Throws:

        IllegalArgumentException - if no cell was found for the column id

        See Also:

        Grid.Column.setId(String)

      • getCell

        public CELL getCell​(Grid.Column<?,​?> column)

        Returns the cell in this section that corresponds to the given column.

        Parameters:

        column - the column

        Returns:

        the cell for the given column

        Throws:

        IllegalArgumentException - if no cell was found for the column

      • getStyleName

        public String getStyleName()

        Returns the custom style name for this row.

        Returns:

        the style name or null if no style name has been set

      • setStyleName

        public void setStyleName​(String styleName)

        Sets a custom style name for this row.

        Parameters:

        styleName - the style name to set or null to not use any style name

      • internalGetCell

        protected CELL internalGetCell​(String internalId)

        Returns the cell in this section that corresponds to the given internal column id.

        Parameters:

        internalId - the internal id of the column

        Returns:

        the cell for the given column

        Throws:

        IllegalArgumentException - if no cell was found for the column id

      • readDesign

        protected void readDesign​(org.jsoup.nodes.Element trElement,
                                  DesignContext designContext)
                           throws DesignException

        Reads the declarative design from the given table row element.

        Parameters:

        trElement - Element to read design from

        designContext - the design context

        Throws:

        DesignException - if the given table row contains unexpected children

        Since:

        7.5.0

      • writeDesign

        protected void writeDesign​(org.jsoup.nodes.Element trElement,
                                   DesignContext designContext)

        Writes the declarative design to the given table row element.

        Parameters:

        trElement - Element to write design to

        designContext - the design context

        Since:

        7.5.0

      • writeCellState

        protected void writeCellState​(org.jsoup.nodes.Element cellElement,
                                      DesignContext context,
                                      SectionState.CellState state)

        Writes declarative design for the cell using its state to the given table cell element.

        The method is used instead of StaticCell::writeDesign because sometimes there is no a reference to the cell which should be written (merged cell) but only its state is available (the cell is virtual and is not stored).

        Parameters:

        cellElement - Element to write design to

        context - the design context

        state - a cell state