Package com.vaadin.flow.component.html
Class NativeTableRow
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.HtmlComponent
com.vaadin.flow.component.HtmlContainer
com.vaadin.flow.component.html.NativeTableRow
- All Implemented Interfaces:
AttachNotifier
,ClickNotifier<NativeTableRow>
,DetachNotifier
,HasComponents
,HasElement
,HasEnabled
,HasOrderedComponents
,HasSize
,HasStyle
,HasText
,Serializable
@Tag("tr")
public class NativeTableRow
extends HtmlContainer
implements HasOrderedComponents, ClickNotifier<NativeTableRow>
Component representing a
<tr>
element.- Since:
- 24.4
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasText
HasText.WhiteSpace
-
Constructor Summary
ConstructorDescriptionCreates a new empty table row component.NativeTableRow
(Component... components) Creates a new table row with the given children components. -
Method Summary
Modifier and TypeMethodDescriptionAdd a data cell to this row.Add a header cell to this row.Returns a list of all cells in this row.getCell
(int index) Returns the cell at a given position.getDataCell
(int index) Returns the data cell at a given position relative to other data cells.Returns a list of all data cells in this row.getHeaderCell
(int index) Returns the header cell at a given position relative to other header cells.Returns a list of all header cells in this row.insertDataCell
(int position) Insert a new data cell into a given position.insertHeaderCell
(int position) Insert a new header cell into a given position.void
removeCell
(int index) Removes the cell at a given position.void
removeDataCell
(int index) Removes the data cell at a given position relative to other data cells.void
removeDataCell
(NativeTableCell dataCell) Removes a data cell.void
removeHeaderCell
(int index) Removes the header cell at a position relative to other header cells.void
removeHeaderCell
(NativeTableHeaderCell headerCell) Removes a header cell.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
-
NativeTableRow
public NativeTableRow()Creates a new empty table row component. -
NativeTableRow
Creates a new table row with the given children components.- Parameters:
components
- the children components.
-
-
Method Details
-
addHeaderCell
Add a header cell to this row.- Returns:
- the new
<th>
element.
-
insertHeaderCell
Insert a new header cell into a given position.- Parameters:
position
- the position into which the header cell must be added.- Returns:
- the new header cell.
-
addDataCell
Add a data cell to this row.- Returns:
- the new
<td>
element.
-
insertDataCell
Insert a new data cell into a given position.- Parameters:
position
- the position into which the data cell must be added.- Returns:
- the new data cell.
-
getHeaderCells
Returns a list of all header cells in this row.- Returns:
- A list of all header cells in this row.
-
getDataCells
Returns a list of all data cells in this row.- Returns:
- A list of all data cells in this row.
-
getAllCells
Returns a list of all cells in this row.- Returns:
- a list of all cells in this row.
-
getHeaderCell
Returns the header cell at a given position relative to other header cells.- Parameters:
index
- the position of the header cell relative to other header cells.- Returns:
- the header cell at the given position (relative to other header cells).
-
getDataCell
Returns the data cell at a given position relative to other data cells.- Parameters:
index
- the position of the data cell relative to other data cells.- Returns:
- the data cell at the given position (relative to other data cells).
-
getCell
Returns the cell at a given position.- Parameters:
index
- the position of the cell.- Returns:
- the cell at the given position
- Throws:
IndexOutOfBoundsException
- if index is negative or greater than (or equal to) the number of cells in the row
-
removeCell
public void removeCell(int index) Removes the cell at a given position.- Parameters:
index
- the position of the cell to remove
-
removeHeaderCell
public void removeHeaderCell(int index) Removes the header cell at a position relative to other header cells.- Parameters:
index
- the position of the header cell relative to other header cells.
-
removeHeaderCell
Removes a header cell.- Parameters:
headerCell
- the header cell to remove.
-
removeDataCell
public void removeDataCell(int index) Removes the data cell at a given position relative to other data cells.- Parameters:
index
- the position of the data cell to remove relative to other data cells.
-
removeDataCell
Removes a data cell.- Parameters:
dataCell
- the data cell to remove.
-