com.vaadin.ui.components.grid.

Class StaticSection<ROW extends StaticSection.StaticRow<?>>

    • Constructor Detail

      • StaticSection

        public StaticSection()
    • Method Detail

      • createRow

        protected abstract ROW createRow()

        Creates a new row instance.

        Returns:

        the new row

      • getState

        protected abstract SectionState getState​(boolean markAsDirty)

        Returns the shared state of this section.

        Parameters:

        markAsDirty - true to mark the state as modified, false otherwise

        Returns:

        the section state

      • getGrid

        protected abstract Grid<?> getGrid()
      • getColumnByInternalId

        protected abstract Grid.Column<?,​?> getColumnByInternalId​(String internalId)
      • getInternalIdForColumn

        protected abstract String getInternalIdForColumn​(Grid.Column<?,​?> column)
      • markAsDirty

        protected void markAsDirty()

        Marks the state of this section as modified.

      • addRowAt

        public ROW addRowAt​(int index)

        Adds a new row at the given index.

        Parameters:

        index - the index of the new row

        Returns:

        the added row

        Throws:

        IndexOutOfBoundsException - if index < 0 || index > getRowCount()

      • removeRow

        public void removeRow​(int index)

        Removes the row at the given index.

        Parameters:

        index - the index of the row to remove

        Throws:

        IndexOutOfBoundsException - if index < 0 || index >= getRowCount()

      • removeRow

        public void removeRow​(Object row)

        Removes the given row from this section.

        Parameters:

        row - the row to remove, not null

        Throws:

        IllegalArgumentException - if this section does not contain the row

      • getRow

        public ROW getRow​(int index)

        Returns the row at the given index.

        Parameters:

        index - the index of the row

        Returns:

        the row at the index

        Throws:

        IndexOutOfBoundsException - if index < 0 || index >= getRowCount()

      • getRowCount

        public int getRowCount()

        Returns the number of rows in this section.

        Returns:

        the number of rows

      • addColumn

        public void addColumn​(String columnId)

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

        Parameters:

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

      • removeColumn

        public void removeColumn​(String columnId)

        Removes the cell corresponding to the given column id.

        Parameters:

        columnId - the id of the column whose cell to remove

      • writeDesign

        public void writeDesign​(org.jsoup.nodes.Element tableSectionElement,
                                DesignContext designContext)

        Writes the declarative design to the given table section element.

        Parameters:

        tableSectionElement - Element to write design to

        designContext - the design context

      • readDesign

        public void readDesign​(org.jsoup.nodes.Element tableSectionElement,
                               DesignContext designContext)
                        throws DesignException

        Reads the declarative design from the given table section element.

        Parameters:

        tableSectionElement - Element to read design from

        designContext - the design context

        Throws:

        DesignException - if the table section contains unexpected children

        Since:

        7.5.0

      • getRows

        protected List<ROW> getRows()

        Returns an unmodifiable list of the rows in this section.

        Returns:

        the rows in this section

      • setVisible

        public void setVisible​(boolean visible)

        Sets the visibility of this section.

        Parameters:

        visible - true if visible; false if not

        Since:

        8.1.1

      • isVisible

        public boolean isVisible()

        Gets the visibility of this section.

        Returns:

        true if visible; false if not

        Since:

        8.1.1