Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » TreeViewer getChildren() method
TreeViewer getChildren() method [message #465727] Wed, 04 April 2007 05:28 Go to next message
Swetha is currently offline SwethaFriend
Messages: 68
Registered: July 2009
Member
Hi,

I have a tree viewer, I am getting Children of a tree node dynamically
by executing the query in getChildren() method in ContentProvider...
getChildren() method is executed owhen I click on '+' symbol of a tree
node...so automatically , query is executed and children get added to the
parent node.,..

I want the same thing to happen not only on click of '+' symbol but
also on mouse double click of a node...

How can make sure the getChildren() is executed and children get added
automatically.. without writing the code of adding children to tree node..

Thanks in advance,
Swetha
Re: TreeViewer getChildren() method [message #465755 is a reply to message #465727] Wed, 04 April 2007 16:16 Go to previous message
Ali Alauoubiy is currently offline Ali AlauoubiyFriend
Messages: 20
Registered: July 2009
Junior Member
Try this:

treeViewer.addOpenListener(new IOpenListener() {
public void open(OpenEvent event) {

ISelection selection = treeViewer.getSelection();
Object obj = (Object) ((IStructuredSelection) selection).getFirstElement(); treeViewer.expandToLevel(obj, 1);

}
});
Previous Topic:how to add dependency to eclipse.update.ui
Next Topic:Opening a modal application window
Goto Forum:
  


Current Time: Fri Apr 19 11:58:16 GMT 2024

Powered by FUDForum. Page generated in 0.01375 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top