T
- the grid bean typepublic static class Grid.GridContextClickEvent<T> extends ContextClickEvent
Usage:
grid.addContextClickListener(event -> Notification.show( ((GridContextClickEvent<Person>) event).getItem() + " Clicked"));
ContextClickEvent.ContextClickListener, ContextClickEvent.ContextClickNotifier
CONTEXT_CLICK_METHOD
BUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHT
source
Constructor and Description |
---|
GridContextClickEvent(Grid<T> source,
MouseEventDetails mouseEventDetails,
GridConstants.Section section,
int rowIndex,
T item,
Grid.Column<T,?> column)
Creates a new context click event.
|
Modifier and Type | Method and Description |
---|---|
Grid.Column<T,?> |
getColumn()
Returns the clicked column.
|
Grid<T> |
getComponent()
Gets the component where the event occurred.
|
T |
getItem()
Returns the item of context clicked row.
|
int |
getRowIndex()
Returns the clicked row index.
|
GridConstants.Section |
getSection()
Return the clicked section of Grid.
|
getButton, getButtonName, getClientX, getClientY, getMouseEventDetails, getRelativeX, getRelativeY, isAltKey, isCtrlKey, isDoubleClick, isMetaKey, isShiftKey
getConnector
getSource, toString
public GridContextClickEvent(Grid<T> source, MouseEventDetails mouseEventDetails, GridConstants.Section section, int rowIndex, T item, Grid.Column<T,?> column)
source
- the grid where the context click occurredmouseEventDetails
- details about mouse positionsection
- the section of the grid which was clickedrowIndex
- the index of the row which was clickeditem
- the item which was clickedcolumn
- the column which was clickedpublic T getItem()
null
if header or footerpublic Grid.Column<T,?> getColumn()
public GridConstants.Section getSection()
public int getRowIndex()
Header and Footer rows for index can be fetched with
Grid.getHeaderRow(int)
and Grid.getFooterRow(int)
.
public Grid<T> getComponent()
Component.Event
getComponent
in class Component.Event
Copyright © 2018 Vaadin Ltd. All rights reserved.