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());
}
}
});
}
Aggregations