GridDataFactory.fillDefaults().grab(true, true).span(2, 1).applyTo(treeViewer.getControl());
treeViewer.setContentProvider(makeContentProvider());
treeViewer.setLabelProvider(makeLabelProvider());
treeViewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
TreeSelection selection = (TreeSelection) event.getSelection();
if (selection.getFirstElement() == null) {
return;
}
// Use path instead of object to avoid direct object comparison
treeViewer.setExpandedState(selection.getPaths()[0],
!treeViewer.getExpandedState(selection.getPaths()[0]));
}
});
treeViewer.setInput(datasets);
// DnD support