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 10: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 13: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 13:35 Go to previous message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5242
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: Fri Jul 25 01:21:17 EDT 2014

Powered by FUDForum. Page generated in 0.01594 seconds