Class TableColumnGroup

java.lang.Object
com.vaadin.flow.component.Component
org.vaadin.firitin.fields.internalhtmltable.TableColumnGroup
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasStyle, 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:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Adds a single column instance to this group.
    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.
    getColumn(int index)
    Returns the column with the given index or an empty optional, if the index is out of bounds.
    Returns the columns of this instance as a list.
    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
    Removes all columns.
    void
    removeColumn(int index)
    Removes the column with the given index.
    void
    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.
    Returns the columns of this instance as a stream.

    Methods inherited from class com.vaadin.flow.component.Component

    addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisible

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.component.AttachNotifier

    addAttachListener

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

    addDetachListener

    Methods inherited from interface com.vaadin.flow.component.HasStyle

    addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
  • Constructor Details

    • TableColumnGroup

      public TableColumnGroup()
  • Method Details

    • 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
    • setColumn

      public void setColumn(int index, TableColumn column)
      Replaces a single column instance to the given index in this group and replaces the existing column.

      This method has the same functionality as replaceColumn(int, TableColumn).
      Parameters:
      index - index to set the new item to
      column - column
      See Also:
    • 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