com.vaadin.flow.component.grid.
Class CellFocusEvent<T>
- java.lang.Object
-
- java.util.EventObject
-
- com.vaadin.flow.component.ComponentEvent<Grid<T>>
-
- com.vaadin.flow.component.grid.CellFocusEvent<T>
-
Type Parameters:
T
- the grid bean typeAll Implemented Interfaces:
@DomEvent("grid-cell-focus") public class CellFocusEvent<T> extends ComponentEvent<Grid<T>>
Event fired when a cell in the Grid is focused.
Author:
Vaadin Ltd
See Also:
Grid.addCellFocusListener(com.vaadin.flow.component.ComponentEventListener)
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CellFocusEvent.GridSection
An enum representing the different sections of a grid.
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Method Summary
All Methods Modifier and Type Method Description Optional<Grid.Column<T>>
getColumn()
Returns the column represented by the focused cell.
Optional<T>
getItem()
Returns the item represented by the focused cell.
CellFocusEvent.GridSection
getSection()
Returns the grid section, where this cell is located.
boolean
isBodyCell()
Indicates, if the clicked cell is part of the grid's body section.
boolean
isFooterCell()
Indicates, if the clicked cell is part of the grid's footer section.
boolean
isHeaderCell()
Indicates, if the clicked cell is part of the grid's header section.
-
Methods inherited from class com.vaadin.flow.component.ComponentEvent
getSource, isFromClient, unregisterListener
-
Methods inherited from class java.util.EventObject
toString
-
-
-
-
Constructor Detail
-
CellFocusEvent
public CellFocusEvent​(Grid<T> source, boolean fromClient, @EventData("event.detail.itemKey") String itemKey, @EventData("event.detail.internalColumnId") String internalColumnId, @EventData("event.detail.section") String sectionName)
Creates a new cell focus event.
Parameters:
source
- the source componentfromClient
-true
if the event originated from the client
-
-
Method Detail
-
isBodyCell
public boolean isBodyCell()
Indicates, if the clicked cell is part of the grid's body section.
Returns:
is a body cell
-
isHeaderCell
public boolean isHeaderCell()
Indicates, if the clicked cell is part of the grid's header section.
Returns:
is a header cell
-
isFooterCell
public boolean isFooterCell()
Indicates, if the clicked cell is part of the grid's footer section.
Returns:
is a footer cell
-
getSection
public CellFocusEvent.GridSection getSection()
Returns the grid section, where this cell is located. Never null.
Returns:
section
-
getItem
public Optional<T> getItem()
Returns the item represented by the focused cell. Is empty, when the focused cell is not a body cell.
Returns:
item or empty
-
getColumn
public Optional<Grid.Column<T>> getColumn()
Returns the column represented by the focused cell. Is empty, when the focused cell is a header group (a cell with a cellspan > 1).
Returns:
column or empty
-
-