Package com.vaadin.flow.component.grid
Class ItemClickEvent<T>
- java.lang.Object
-
- java.util.EventObject
-
- com.vaadin.flow.component.ComponentEvent<C>
-
- com.vaadin.flow.component.ClickEvent<Grid<T>>
-
- com.vaadin.flow.component.grid.ItemClickEvent<T>
-
- Type Parameters:
T
- the grid bean type
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ItemDoubleClickEvent
@DomEvent("item-click") public class ItemClickEvent<T> extends com.vaadin.flow.component.ClickEvent<Grid<T>>
Event fired when a Grid item is clicked.- Author:
- Vaadin Ltd
- See Also:
Grid.addItemClickListener(com.vaadin.flow.component.ComponentEventListener)
, Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description ItemClickEvent(Grid<T> source, boolean fromClient, String itemKey, int screenX, int screenY, int clientX, int clientY, int clickCount, int button, boolean ctrlKey, boolean shiftKey, boolean altKey, boolean metaKey)
Deprecated.Please use the constructor with an extra parameterinternalColumnId
ItemClickEvent(Grid<T> source, boolean fromClient, String itemKey, String internalColumnId, int screenX, int screenY, int clientX, int clientY, int clickCount, int button, boolean ctrlKey, boolean shiftKey, boolean altKey, boolean metaKey)
Creates a new item click event.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Grid.Column<T>
getColumn()
Gets the column that was clicked.T
getItem()
Gets the clicked item.-
Methods inherited from class com.vaadin.flow.component.ClickEvent
getButton, getClickCount, getClientX, getClientY, getScreenX, getScreenY, isAltKey, isCtrlKey, isMetaKey, isShiftKey
-
Methods inherited from class com.vaadin.flow.component.ComponentEvent
getSource, isFromClient, unregisterListener
-
Methods inherited from class java.util.EventObject
toString
-
-
-
-
Constructor Detail
-
ItemClickEvent
public ItemClickEvent(Grid<T> source, boolean fromClient, @EventData("event.detail.itemKey") String itemKey, @EventData("event.detail.internalColumnId") String internalColumnId, @EventData("event.detail.screenX") int screenX, @EventData("event.detail.screenY") int screenY, @EventData("event.detail.clientX") int clientX, @EventData("event.detail.clientY") int clientY, @EventData("event.detail.detail") int clickCount, @EventData("event.detail.button") int button, @EventData("event.detail.ctrlKey") boolean ctrlKey, @EventData("event.detail.shiftKey") boolean shiftKey, @EventData("event.detail.altKey") boolean altKey, @EventData("event.detail.metaKey") boolean metaKey)
Creates a new item click event.- Parameters:
source
- the component that fired the eventfromClient
-true
if the event was originally fired on the client,false
if the event originates from server-side logicitemKey
- the item mapper keyinternalColumnId
- the internal id of the column associated with the click eventscreenX
- the x coordinate of the click event, relative to the upper left corner of the screen, -1 if unknownscreenY
- the y coordinate of the click event, relative to the upper left corner of the screen, -i if unknownclientX
- the x coordinate of the click event, relative to the upper left corner of the browser viewport, -1 if unknownclientY
- the y coordinate of the click event, relative to the upper left corner of the browser viewport, -1 if unknownclickCount
- the number of consecutive clicks recently recordedbutton
- the id of the pressed mouse buttonctrlKey
-true
if the control key was down when the event was fired,false
otherwiseshiftKey
-true
if the shift key was down when the event was fired,false
otherwisealtKey
-true
if the alt key was down when the event was fired,false
otherwisemetaKey
-true
if the meta key was down when the event was fired,false
otherwise
-
ItemClickEvent
@Deprecated public ItemClickEvent(Grid<T> source, boolean fromClient, String itemKey, int screenX, int screenY, int clientX, int clientY, int clickCount, int button, boolean ctrlKey, boolean shiftKey, boolean altKey, boolean metaKey)
Deprecated.Please use the constructor with an extra parameterinternalColumnId
Creates a new item click event.- Parameters:
source
- the component that fired the eventfromClient
-true
if the event was originally fired on the client,false
if the event originates from server-side logicitemKey
- the item mapper keyscreenX
- the x coordinate of the click event, relative to the upper left corner of the screen, -1 if unknownscreenY
- the y coordinate of the click event, relative to the upper left corner of the screen, -i if unknownclientX
- the x coordinate of the click event, relative to the upper left corner of the browser viewport, -1 if unknownclientY
- the y coordinate of the click event, relative to the upper left corner of the browser viewport, -1 if unknownclickCount
- the number of consecutive clicks recently recordedbutton
- the id of the pressed mouse buttonctrlKey
-true
if the control key was down when the event was fired,false
otherwiseshiftKey
-true
if the shift key was down when the event was fired,false
otherwisealtKey
-true
if the alt key was down when the event was fired,false
otherwisemetaKey
-true
if the meta key was down when the event was fired,false
otherwise
-
-
Method Detail
-
getItem
public T getItem()
Gets the clicked item.- Returns:
- the clicked item
-
getColumn
public Grid.Column<T> getColumn()
Gets the column that was clicked.- Returns:
- the clicked column, not
null
-
-