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,Serializable
@Tag("colgroup") public class TableColumnGroup extends com.vaadin.flow.component.ComponentRepresents a table column group element (<colgroup>). Contains a list of column elements.- Author:
- Stefan Uebe
- See Also:
TableColumn, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TableColumnGroup()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TableColumnaddColumn()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).voidaddColumns(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.TableColumninsertColumn(int index)Inserts a single column instance at the given index to this group.voidinsertColumns(int index, TableColumn... columns)Inserts the given columns at the given index to this instance.voidremoveAllColumns()Removes all columns.voidremoveColumn(int index)Removes the column with the given index.voidremoveColumns(TableColumn... columns)Removes the given columns from this instance.voidreplaceColumn(int index, TableColumn column)Replaces a single column instance to the given index in this group and replaces the existing column.voidsetColumn(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
-
-
-
-
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 atcolumns- 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 asreplaceColumn(int, TableColumn).- Parameters:
index- index to set the new item tocolumn- column- See Also:
replaceColumn(int, TableColumn)
-
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 tocolumn- 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
-
-