Package com.vaadin.flow.component.html
Class NativeTableHeader
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.HtmlComponent
com.vaadin.flow.component.HtmlContainer
com.vaadin.flow.component.html.NativeTableHeader
- All Implemented Interfaces:
AttachNotifier,ClickNotifier<NativeTableHeader>,DetachNotifier,HasComponents,HasElement,HasEnabled,HasOrderedComponents,HasSize,HasStyle,HasText,Serializable
@Tag("thead")
public class NativeTableHeader
extends HtmlContainer
implements ClickNotifier<NativeTableHeader>
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 NativeTableRowaddRow()Create and append a row to the end of the container.default voidaddRows(NativeTableRow... rows) Appends a list of rows to the container.default Optional<NativeTableRow> getRow(int index) Returns the row at the given index.default longReturns the number of rows in the container.default intGet the index of a given row.default List<NativeTableRow> getRows()Returns a list of all the rows.default NativeTableRowinsertRow(int position) Create and insert a row at a given position.default voidRemove all the rows in the container.default voidremoveRow(int index) Remove the row at the given index.default voidremoveRows(NativeTableRow... rows) Remove a list of rows from the container.default voidreplaceRow(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, setTitleMethods 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, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.ClickNotifier
addClickListener, addClickShortcut, addDoubleClickListener, addSingleClickListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasComponents
add, add, add, addComponentAsFirst, addComponentAtIndex, remove, remove, removeAllMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasOrderedComponents
getChildren, getComponentAt, getComponentCount, indexOf, replaceMethods 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, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods 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.
-