com.vaadin.ui.

Class Grid.GridContextClickEvent<T>

  • Type Parameters:

    T - the grid bean type

    All Implemented Interfaces:

    Serializable

    Enclosing class:

    Grid<T>

    public static class Grid.GridContextClickEvent<T>
    extends ContextClickEvent

    ContextClickEvent for the Grid Component.

    Usage:

     grid.addContextClickListener(event -> Notification.show(
             ((GridContextClickEvent<Person>) event).getItem() + " Clicked"));
     

    See Also:

    Serialized Form

    • Constructor Detail

      • GridContextClickEvent

        public GridContextClickEvent​(Grid<T> source,
                                     MouseEventDetails mouseEventDetails,
                                     GridConstants.Section section,
                                     int rowIndex,
                                     T item,
                                     Grid.Column<T,​?> column)

        Creates a new context click event.

        Parameters:

        source - the grid where the context click occurred

        mouseEventDetails - details about mouse position

        section - the section of the grid which was clicked

        rowIndex - the index of the row which was clicked

        item - the item which was clicked

        column - the column which was clicked

    • Method Detail

      • getItem

        public T getItem()

        Returns the item of context clicked row.

        Returns:

        item of clicked row; null if header or footer

      • getColumn

        public Grid.Column<T,​?> getColumn()

        Returns the clicked column.

        Returns:

        the clicked column

      • getSection

        public GridConstants.Section getSection()

        Return the clicked section of Grid.

        Returns:

        section of grid