You add a single double click listener to the TreeViewer
with the addDoubleClickListener
method. The parameter is a class that implements IDoubleClickListener
:
treeViewer.addDoubleClickListener(new IDoubleClickListener() {
@Override
public void doubleClick(final DoubleClickEvent event)
{
final IStructuredSelection selection = (IStructuredSelection)event.getSelection();
// TODO deal with the selection
}
});
The DoubleClickEvent
parameter contains the information about the selected object in the tree.