Class TableColumnGroup

  • All Implemented Interfaces:
    com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, Serializable

    @Tag("colgroup")
    public class TableColumnGroup
    extends com.vaadin.flow.component.Component
    Represents a table column group element (<colgroup>). Contains a list of column elements.
    Author:
    Stefan Uebe
    See Also:
    TableColumn, Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      TableColumn addColumn()
      Adds a single column instance to this group.
      TableColumn[] addColumns​(int columns)
      Adds multiple columns to this instance based on the given integer (must be greater than 0).
      void addColumns​(TableColumn... columns)
      Adds the given columns to this instance.
      Optional<TableColumn> getColumn​(int index)
      Returns the column with the given index or an empty optional, if the index is out of bounds.
      List<TableColumn> getColumns()
      Returns the columns of this instance as a list.
      TableColumn insertColumn​(int index)
      Inserts a single column instance at the given index to this group.
      void insertColumns​(int index, TableColumn... columns)
      Inserts the given columns at the given index to this instance.
      void removeAllColumns()
      Removes all columns.
      void removeColumn​(int index)
      Removes the column with the given index.
      void removeColumns​(TableColumn... columns)
      Removes the given columns from this instance.
      void replaceColumn​(int index, TableColumn column)
      Replaces a single column instance to the given index in this group and replaces the existing column.
      void setColumn​(int index, TableColumn column)
      Replaces a single column instance to the given index in this group and replaces the existing column.
      Stream<TableColumn> streamColumns()
      Returns the columns of this instance as a stream.
      • Methods inherited from class com.vaadin.flow.component.Component

        addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisible
      • Methods inherited from interface com.vaadin.flow.component.AttachNotifier

        addAttachListener
      • Methods inherited from interface com.vaadin.flow.component.DetachNotifier

        addDetachListener
    • Constructor Detail

      • TableColumnGroup

        public TableColumnGroup()
    • Method Detail

      • addColumn

        public TableColumn addColumn()
        Adds a single column instance to this group. The created column is returned for further configuration.
        Returns:
        the created column
      • addColumns

        public void addColumns​(TableColumn... columns)
        Adds the given columns to this instance.
        Parameters:
        columns - columns
      • addColumns

        public TableColumn[] addColumns​(int columns)
        Adds multiple columns to this instance based on the given integer (must be greater than 0). The created columns are returned as an array, that can be used for further configuration.
        Parameters:
        columns - amount of columns to add
        Returns:
        created column objects
      • insertColumn

        public TableColumn insertColumn​(int index)
        Inserts a single column instance at the given index to this group. Existing items will be placed after the inserted items. The created column is returned for further configuration.
        Parameters:
        index - index to insert the column at
        Returns:
        the created column
      • insertColumns

        public void insertColumns​(int index,
                                  TableColumn... columns)
        Inserts the given columns at the given index to this instance. Existing items will be placed after the inserted items.
        Parameters:
        index - index to insert the columns at
        columns - columns
      • replaceColumn

        public void replaceColumn​(int index,
                                  TableColumn column)
        Replaces a single column instance to the given index in this group and replaces the existing column.
        Parameters:
        index - index to set the new item to
        column - column
      • removeColumn

        public void removeColumn​(int index)
        Removes the column with the given index. Noop, if no column has been found for that index.
        Parameters:
        index - index to remove
      • removeColumns

        public void removeColumns​(TableColumn... columns)
        Removes the given columns from this instance. Items, that are not child of this instance, will lead to an exception.
        Parameters:
        columns - columns to remove
      • removeAllColumns

        public void removeAllColumns()
        Removes all columns.
      • getColumns

        public List<TableColumn> getColumns()
        Returns the columns of this instance as a list. Changes to this list do not affect this instance. Empty if no columns have been added yet.
        Returns:
        columns as list
      • getColumn

        public Optional<TableColumn> getColumn​(int index)
        Returns the column with the given index or an empty optional, if the index is out of bounds.
        Parameters:
        index - index
        Returns:
        column or empty
      • streamColumns

        public Stream<TableColumn> streamColumns()
        Returns the columns of this instance as a stream. Empty if no columns have been added yet.
        Returns:
        columns as stream