java - Children of Parent in JFace TreeViewer -


how retrieve children of selected item in jface treeviewer? able parent of selected item, not children.

you use tree content provider both children , parent of selection in tree viewer.

istructuredselection sel = treeviewer.getstructuredselection();  object selelement = sel.getfirstelement();  itreecontentprovider provider = (itreecontentprovider)treeviewer.getcontentprovider();  object [] children = provider.getchildren(selelement);  object parent = provider.getparent(selelement); 

note: when using treeviewer should avoid looking @ tree or treeitem controls treeviewer uses internally.


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -