Class CellFocusEvent<T>

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