I am writing code to create a tree in SWT RCP. In this tree, I want to implement a functionality - When I double on a node, The name of the node should be displayed. The wrote for that purpose is -
private void addDoubleClickListener() {
// TODO Auto-generated method stub
treeViewer.addDoubleClickListener(new IDoubleClickListener() {
@Override
public void doubleClick(DoubleClickEvent e) {
ISelection selection = e.getSelection();
if (selection instanceof IStructuredSelection) {
Object item = ((IStructuredSelection) selection)
.getFirstElement();
if (item == null) {
return;
} else {
System.out.println(item.toString());
}
}
}
});
}
It is working fine . But, my problem is, the nodes in my tree are editable. So, after a node is edited, when I double click on the node, it still displays the old data. Is there any solution for that?
Thanks!