com.vaadin.flow.component.html.
Class NativeTableHeader
All Implemented Interfaces:
AttachNotifier
, ClickNotifier<NativeTableHeader>
, DetachNotifier
, HasComponents
, HasElement
, HasEnabled
, HasOrderedComponents
, HasSize
, HasStyle
, HasText
, Serializable
Component representing a <thead>
element.
Since:
24.4
See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasText
HasText.WhiteSpace
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new empty table header component.
NativeTableHeader
(Component... components) Creates a new table header with the given children components.
-
Method Summary
Modifier and TypeMethodDescriptiondefault NativeTableRow
addRow()
Create and append a row to the end of the container.
default void
addRows
(NativeTableRow... rows) Appends a list of rows to the container.
default Optional<NativeTableRow>
getRow
(int index) Returns the row at the given index.
default long
Returns the number of rows in the container.
default int
Get the index of a given row.
default List<NativeTableRow>
getRows()
Returns a list of all the rows.
default NativeTableRow
insertRow
(int position) Create and insert a row at a given position.
default void
Remove all the rows in the container.
default void
removeRow
(int index) Remove the row at the given index.
default void
removeRows
(NativeTableRow... rows) Remove a list of rows from the container.
default void
replaceRow
(int index, NativeTableRow row) Replaces the row at a given position with a new one.
Methods inherited from class com.vaadin.flow.component.HtmlComponent
getTitle, setTitle
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.ClickNotifier
addClickListener, addClickShortcut, addDoubleClickListener, addSingleClickListener
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
Methods inherited from interface com.vaadin.flow.component.HasComponents
add, add, add, addComponentAsFirst, addComponentAtIndex, remove, remove, removeAll
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
Methods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabled
Methods inherited from interface com.vaadin.flow.component.HasOrderedComponents
getChildren, getComponentAt, getComponentCount, indexOf, replace
Methods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull
Methods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
Methods inherited from interface com.vaadin.flow.component.HasText
getText, getWhiteSpace, setText, setWhiteSpace
-
Constructor Details
-
NativeTableHeader
public NativeTableHeader()Creates a new empty table header component.
-
NativeTableHeader
Creates a new table header with the given children components.
Parameters:
components
- the children components.
-
-
Method Details
-
getRowIndex
Get the index of a given row.
Parameters:
row
- the row to get the index of.Returns:
the index of the row.
-
getRows
Returns a list of all the rows.
Returns:
all the rows in the container.
-
getRow
Returns the row at the given index.
Parameters:
index
- the index of the row. Must be greater than 0 and less than the size of the container.Returns:
the row at position
index
. -
addRows
Appends a list of rows to the container.
Parameters:
rows
- the rows to append. -
addRow
Create and append a row to the end of the container.
Returns:
the new row.
-
insertRow
Create and insert a row at a given position.
Parameters:
position
- a value greater than 0 and less than the container's size.Returns:
the new row.
-
removeRows
Remove a list of rows from the container.
Parameters:
rows
- the rows to remove. If a component in the list is not a child of the container, it will throw an exception. -
removeRow
default void removeRow(int index) Remove the row at the given index.
Parameters:
index
- the position of the row to remove. -
removeAllRows
default void removeAllRows()Remove all the rows in the container.
-
replaceRow
Replaces the row at a given position with a new one. If both rows exist within the container, they swap positions.
Parameters:
index
- the index of the row to replace.row
- the new row to insert at the position of the old row. -
getRowCount
default long getRowCount()Returns the number of rows in the container.
Returns:
the row count.
-