Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » preserving tree state when updating viewer input
preserving tree state when updating viewer input [message #461580] Mon, 26 September 2005 20:08 Go to next message
Duncan Krebs is currently offline Duncan KrebsFriend
Messages: 79
Registered: July 2009
Member
Hi,
I'm getting tired of my Jface tree viewer minimizing itself after I update
the tree with new data when the user returns from a wizard. To update the
data I'm just calling the setInput method of the tree viewer with the
updated data. After I do this the tree gets minimized again.

Does anyone know how I can keep the tree expanded after setting the input?
Is there a different method to call to update the data with? Can I say
something like "expand the tree to the first level." Thanks for any ideas.
- Duncan
Re: preserving tree state when updating viewer input [message #461581 is a reply to message #461580] Mon, 26 September 2005 20:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

"Duncan Krebs" <duncan@krebsnet.com> wrote in message
news:910dade3fa42f6ba732e1ec296c89bef$1@www.eclipse.org...
> Hi,
> I'm getting tired of my Jface tree viewer minimizing itself after I update
> the tree with new data when the user returns from a wizard. To update the
> data I'm just calling the setInput method of the tree viewer with the
> updated data. After I do this the tree gets minimized again.
> Does anyone know how I can keep the tree expanded after setting the input?
> Is there a different method to call to update the data with? Can I say
> something like "expand the tree to the first level." Thanks for any
> ideas. - Duncan
Instead of calling setInput, why not just update the model and call
refresh()?
---
Sunil
Re: preserving tree state when updating viewer input [message #461708 is a reply to message #461581] Tue, 27 September 2005 19:48 Go to previous messageGo to next message
Duncan Krebs is currently offline Duncan KrebsFriend
Messages: 79
Registered: July 2009
Member
Sunil Kamath wrote:

> Instead of calling setInput, why not just update the model and call
> refresh()?
> ---
> Sunil

Thanks for the suggestion, I rewrote my code so it does that. After the
model update and refresh it keeps the first level of the tree expanded but
does not preserve the state of additional levels that were expanded before
the refresh (it closes them all but the first level). Do you know if this
is regular behavior?
Re: preserving tree state when updating viewer input [message #461709 is a reply to message #461708] Tue, 27 September 2005 20:30 Go to previous message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

"Duncan Krebs" <duncan@krebsnet.com> wrote in message
news:9aed499027baa2ab2786912fc387a3b5$1@www.eclipse.org...
> Sunil Kamath wrote:
>
>> Instead of calling setInput, why not just update the model and call
>> refresh()?
>> ---
>> Sunil
>
> Thanks for the suggestion, I rewrote my code so it does that. After the
> model update and refresh it keeps the first level of the tree expanded but
> does not preserve the state of additional levels that were expanded before
> the refresh (it closes them all but the first level). Do you know if this
> is regular behavior?
>
I think it depends upon which elements were changed.
Do you have a working snippet that shows the problem?
---
Sunil
Previous Topic:JarFile
Next Topic:Can I use TabFolder widget on IBM J9 ?
Goto Forum:
  


Current Time: Tue Apr 23 12:27:10 GMT 2024

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

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

Back to the top