Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to refresh the Tree Element while expanding
How to refresh the Tree Element while expanding [message #467759] Thu, 10 May 2007 14:27 Go to next message
Eclipse User
Originally posted by: johansusai.yahoo.co.in

I have created tree using Treeviewer. while expanding the tree element i want to refresh that particular node along with its child. kindly give suggestion on how to do this.

whether to use listener or is there other any way to do it.

Thanks,
johan
Re: How to refresh the Tree Element while expanding [message #467773 is a reply to message #467759] Thu, 10 May 2007 17:10 Go to previous messageGo to next message
David Kyle is currently offline David Kyle
Messages: 125
Registered: July 2009
Senior Member
Johan,

Try using a ITreeContentProvider with your Treeviewer.
ITreeContentProvider#getChildren(Object) will give you the flexibility of
caching your results or always fetching the most current children.

treeviewer.setContentProvider(new ITreeContentProvider() {
// implement interface
});

David

"Johanantonysusai" <johansusai@yahoo.co.in> wrote in message
news:15551278.1178807288426.JavaMail.root@cp1.javalobby.org...
>I have created tree using Treeviewer. while expanding the tree element i
>want to refresh that particular node along with its child. kindly give
>suggestion on how to do this.
>
> whether to use listener or is there other any way to do it.
>
> Thanks,
> johan
Re: How to refresh the Tree Element while expanding [message #467781 is a reply to message #467773] Thu, 10 May 2007 17:35 Go to previous message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5320
Registered: July 2009
Senior Member
Hi,

That's not true. When the items are already created the this method is
not called any more. You need to to call treeViewer#refresh(Object).
This will refresh the children from this object.

Tom


David Kyle schrieb:
> Johan,
>
> Try using a ITreeContentProvider with your Treeviewer.
> ITreeContentProvider#getChildren(Object) will give you the flexibility of
> caching your results or always fetching the most current children.
>
> treeviewer.setContentProvider(new ITreeContentProvider() {
> // implement interface
> });
>
> David
>
> "Johanantonysusai" <johansusai@yahoo.co.in> wrote in message
> news:15551278.1178807288426.JavaMail.root@cp1.javalobby.org...
>> I have created tree using Treeviewer. while expanding the tree element i
>> want to refresh that particular node along with its child. kindly give
>> suggestion on how to do this.
>>
>> whether to use listener or is there other any way to do it.
>>
>> Thanks,
>> johan
>
>
Previous Topic:Redirect logs
Next Topic:Eclipse RCP 3.3M6 and Java Web Start
Goto Forum:
  


Current Time: Wed Sep 17 03:42:24 GMT 2014

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

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