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

  • Type Parameters:
    CELL - the type of the cells in the row
    All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    Footer.Row, Header.Row
    Enclosing class:
    StaticSection<ROW extends StaticSection.StaticRow<?>>

    public abstract static class StaticSection.StaticRow<CELL extends com.vaadin.ui.components.grid.StaticSection.StaticCell>
    extends java.lang.Object
    implements java.io.Serializable
    Abstract base class for Grid header and footer rows.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected StaticRow​(StaticSection<?> section)
      Creates a new row belonging to the given section.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addCell​(Grid.Column<?,​?> column)
      Adds a cell to this section for given column.
      protected void addCell​(java.lang.String columnId)
      Adds a cell to this section, corresponding to the given user-defined column id.
      protected abstract CELL createCell()
      Creates and returns a new instance of the cell type.
      CELL getCell​(Grid.Column<?,​?> column)
      Returns the cell in this section that corresponds to the given column.
      CELL getCell​(java.lang.String columnId)
      Returns the cell in this section that corresponds to the given column id.
      protected abstract java.lang.String getCellTagName()
      Returns the declarative tag name used for the cells in this row.
      java.util.Collection<? extends Component> getComponents()  
      protected com.vaadin.shared.ui.grid.SectionState.RowState getRowState()
      Returns the shared state of this row.
      java.lang.String getStyleName()
      Returns the custom style name for this row.
      protected void internalAddCell​(java.lang.String internalId)
      Adds a cell to this section, corresponding to the given internal column id.
      protected CELL internalGetCell​(java.lang.String internalId)
      Returns the cell in this section that corresponds to the given internal column id.
      protected void readDesign​(org.jsoup.nodes.Element trElement, DesignContext designContext)
      Reads the declarative design from the given table row element.
      protected void removeCell​(java.lang.String columnId)
      Removes the cell from this section that corresponds to the given column id.
      void setStyleName​(java.lang.String styleName)
      Sets a custom style name for this row.
      protected void writeCellState​(org.jsoup.nodes.Element cellElement, DesignContext context, com.vaadin.shared.ui.grid.SectionState.CellState state)
      Writes declarative design for the cell using its state to the given table cell element.
      protected void writeDesign​(org.jsoup.nodes.Element trElement, DesignContext designContext)
      Writes the declarative design to the given table row element.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 java.lang.String getCellTagName()
        Returns the declarative tag name used for the cells in this row.
        Returns:
        the cell tag name
      • addCell

        protected void addCell​(java.lang.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​(java.lang.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​(java.lang.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 com.vaadin.shared.ui.grid.SectionState.RowState getRowState()
        Returns the shared state of this row.
        Returns:
        the row state
      • getCell

        public CELL getCell​(java.lang.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:
        java.lang.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:
        java.lang.IllegalArgumentException - if no cell was found for the column
      • getStyleName

        public java.lang.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​(java.lang.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​(java.lang.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:
        java.lang.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,
                                      com.vaadin.shared.ui.grid.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
      • getComponents

        public java.util.Collection<? extends Component> getComponents()