com.vaadin.ui.

Class Tree.TreeContextClickEvent<T>

  • Type Parameters:

    T - the tree bean type

    All Implemented Interfaces:

    Serializable

    Enclosing class:

    Tree<T>

    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:

    Serialized Form

    • 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 occurred

        mouseEventDetails - details about mouse position

        item - the item which was clicked or null 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