com.vaadin.ui.
Class Grid.GridContextClickEvent<T>
- java.lang.Object
-
- java.util.EventObject
-
- com.vaadin.event.ConnectorEvent
-
- com.vaadin.ui.Component.Event
-
- com.vaadin.event.MouseEvents.ClickEvent
-
- com.vaadin.event.ContextClickEvent
-
- com.vaadin.ui.Grid.GridContextClickEvent<T>
-
Type Parameters:
T
- the grid bean typeAll Implemented Interfaces:
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:
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vaadin.event.ContextClickEvent
ContextClickEvent.ContextClickListener, ContextClickEvent.ContextClickNotifier
-
-
Field Summary
-
Fields inherited from class com.vaadin.event.ContextClickEvent
CONTEXT_CLICK_METHOD
-
Fields inherited from class com.vaadin.event.MouseEvents.ClickEvent
BUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHT
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description GridContextClickEvent(Grid<T> source, MouseEventDetails mouseEventDetails, GridConstants.Section section, int rowIndex, T item, Grid.Column<T,?> column)
Creates a new context click event.
-
Method Summary
All Methods Modifier and Type Method 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.
-
Methods inherited from class com.vaadin.event.MouseEvents.ClickEvent
getButton, getButtonName, getClientX, getClientY, getMouseEventDetails, getRelativeX, getRelativeY, isAltKey, isCtrlKey, isDoubleClick, isMetaKey, isShiftKey
-
Methods inherited from class com.vaadin.event.ConnectorEvent
getConnector
-
Methods inherited from class java.util.EventObject
getSource, toString
-
-
-
-
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 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 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
-
getRowIndex
public int getRowIndex()
Returns the clicked row index.
Header and Footer rows for index can be fetched with
Grid.getHeaderRow(int)
andGrid.getFooterRow(int)
.Returns:
row index in section
-
getComponent
public Grid<T> getComponent()
Description copied from class:
Component.Event
Gets the component where the event occurred.
Overrides:
getComponent
in classComponent.Event
Returns:
the source component of the event
-
-