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.ContextClickNotifier
CONTEXT_CLICK_METHOD
BUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHT
source
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, isShiftKey
getConnector
getSource, toString
public 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.Event
getComponent
in class Component.Event
Copyright © 2023 Vaadin Ltd. All rights reserved.