com.vaadin.ui.
Class Tree.TreeContextClickEvent<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.Tree.TreeContextClickEvent<T>
-
Type Parameters:
T
- the tree bean typeAll Implemented Interfaces:
public static class Tree.TreeContextClickEvent<T> extends ContextClickEvent
ContextClickEvent for the Tree Component.
Usage:
tree.addContextClickListener(event -> Notification.show( ((TreeContextClickEvent<Person>) event).getItem() + " Clicked"));
Since:
8.1
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 TreeContextClickEvent​(Tree<T> source, MouseEventDetails mouseEventDetails, T item)
Creates a new context click event.
-
Method Summary
All Methods Modifier and Type Method Description Tree<T>
getComponent()
Gets the component where the event occurred.
T
getItem()
Returns the item of context clicked row.
-
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
-
TreeContextClickEvent
public TreeContextClickEvent​(Tree<T> source, MouseEventDetails mouseEventDetails, T item)
Creates a new context click event.
Parameters:
source
- the tree where the context click occurredmouseEventDetails
- details about mouse positionitem
- the item which was clicked ornull
if the click happened outside any item
-
-
Method Detail
-
getItem
public T getItem()
Returns the item of context clicked row.
Returns:
clicked item;
null
the click happened outside any item
-
getComponent
public Tree<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
-
-