diff options
author | Ilia Motornyi <elmot@vaadin.com> | 2017-07-10 14:03:03 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-10 14:03:03 +0300 |
commit | 6e6fb1a47428eb106ae0702c96c3dd1095d4f2d4 (patch) | |
tree | fb234eabd70353764aa3e2d98ec454cd3448b339 /server/src | |
parent | cd1d58c02b35feded1a7485309cea992ed38dfd5 (diff) | |
download | vaadin-framework-6e6fb1a47428eb106ae0702c96c3dd1095d4f2d4.tar.gz vaadin-framework-6e6fb1a47428eb106ae0702c96c3dd1095d4f2d4.zip |
Clarification for GridContextClickEvent
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/Grid.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java index 28b7ebcc60..141130b7a2 100644 --- a/server/src/main/java/com/vaadin/ui/Grid.java +++ b/server/src/main/java/com/vaadin/ui/Grid.java @@ -401,6 +401,13 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, /** * ContextClickEvent for the Grid Component. * + * <p> + * Usage: + * <pre> + * grid.addContextClickListener(event -> Notification.show( + * ((GridContextClickEvent<Person>)event).getItem() + " Clicked") + * ); + * </pre> * @param <T> * the grid bean type */ @@ -3376,6 +3383,7 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, * @param listener * the item click listener, not null * @return a registration for the listener + * @see #addContextClickListener */ public Registration addItemClickListener( ItemClickListener<? super T> listener) { @@ -3384,6 +3392,24 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, } /** + * Adds a context click listener that gets notified when a context click + * happens. + * + * @param listener + * the context click listener to add, not null + * actual event provided to the listener is {@link GridContextClickEvent} + * @return a registration object for removing the listener + * + * @since 8.1 + * @see #addItemClickListener + * @see Registration + */ + @Override + public Registration addContextClickListener(ContextClickEvent.ContextClickListener listener) { + return super.addContextClickListener(listener); + } + + /** * Registers a new column visibility change listener. * * @param listener |