Search in sources :

Example 1 with TreeContextClickEvent

use of com.vaadin.ui.Tree.TreeContextClickEvent in project VaadinUtils by rlsutton1.

the class TreeContextMenu method setAsTreeContextMenu.

@Override
public void setAsTreeContextMenu(final Tree tree) {
    this.tree = tree;
    extend(tree);
    setOpenAutomatically(false);
    tree.addContextClickListener(new ContextClickListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void contextClick(ContextClickEvent event) {
            if (event.getButton() == MouseButton.RIGHT) {
                openContext((TreeContextClickEvent) event);
                open(event.getClientX(), event.getClientY());
            }
        }
    });
}
Also used : TreeContextClickEvent(com.vaadin.ui.Tree.TreeContextClickEvent) ContextClickListener(com.vaadin.event.ContextClickEvent.ContextClickListener) TreeContextClickEvent(com.vaadin.ui.Tree.TreeContextClickEvent) ContextClickEvent(com.vaadin.event.ContextClickEvent)

Aggregations

ContextClickEvent (com.vaadin.event.ContextClickEvent)1 ContextClickListener (com.vaadin.event.ContextClickEvent.ContextClickListener)1 TreeContextClickEvent (com.vaadin.ui.Tree.TreeContextClickEvent)1