I´ve created a TreeView
with a ContentProvider
and custom tree elements.
I also have a ISelectionChangedListener
added to the TreeView
.
I want to add an MouseListener
, do detect if an element of the tree is right-clicked and show a popup menu.
If the white area around the tree is clicked, i don´t want to display the popup menu.
The menu is added via Extensions
in the plugin.xml.
How can I now evaluate if a tree
element is right-clicked, so I can show the popup menu (maybe with visibleWhen in the plugin.xml) ?
I also want to clear the selection, if the right-click is detected in the white area of the TreeView
.