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 type

All Implemented Interfaces:

Serializable

@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:

  • Constructor Details

    • 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 component

      fromClient - true if the event originated from the client

  • Method Details

    • 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