T - the tree bean typepublic static class Tree.TreeContextClickEvent<T> extends ContextClickEvent
Usage:
tree.addContextClickListener(event -> Notification.show(
((TreeContextClickEvent<Person>) event).getItem() + " Clicked"));
ContextClickEvent.ContextClickListener, ContextClickEvent.ContextClickNotifierCONTEXT_CLICK_METHODBUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHTsource| Constructor and Description |
|---|
TreeContextClickEvent(Tree<T> source,
MouseEventDetails mouseEventDetails,
T item)
Creates a new context click event.
|
| Modifier and Type | Method and Description |
|---|---|
Tree<T> |
getComponent()
Gets the component where the event occurred.
|
T |
getItem()
Returns the item of context clicked row.
|
getButton, getButtonName, getClientX, getClientY, getMouseEventDetails, getRelativeX, getRelativeY, isAltKey, isCtrlKey, isDoubleClick, isMetaKey, isShiftKeygetConnectorgetSource, toStringpublic TreeContextClickEvent(Tree<T> source, MouseEventDetails mouseEventDetails, T item)
source - the tree where the context click occurredmouseEventDetails - details about mouse positionitem - the item which was clicked or null if the click
happened outside any itempublic T getItem()
null the click happened outside any
itempublic Tree<T> getComponent()
Component.EventgetComponent in class Component.EventCopyright © 2022 Vaadin Ltd. All rights reserved.