TreeViewer with lazy loading [message #189943] |
Mon, 01 August 2005 11:37 |
Eclipse User |
|
|
|
Hi,
I try to set up a TreeViewer in my OutlineView so it has "lazy loading". The
children of an expanded TreeItem shall be calculated when the item is set to
the expanded state. Is this possible wih the GEF TreeViewer? Where can I add
a listener which notifies about expanding/collapsing events?
Thx in advance
|
|
|
Re: TreeViewer with lazy loading [message #190413 is a reply to message #189943] |
Wed, 03 August 2005 18:19 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
The usual way to do this in GraphicalViewers is to return an empty list from
the getModelChildren() method of your EditPart. So, it's children parts
would not be created. Later, when something triggers the lazy loading, you
would invoke refreshChildren() and your getModelChildren() would return the
actual children. However, with TreeViewer, you'll run into the problem that
the trigger for lazy loading is clicking on the plus sign next to the tree
item, and there would be no such sign if the tree item doesn't have any
children initially. Maybe you can play around with that and find a way.
Perhaps returning some bogus model might do it.
"Philipp Marx" <irritated@gmx.de> wrote in message
news:dcl1er$fhs$1@news.eclipse.org...
> Hi,
>
> I try to set up a TreeViewer in my OutlineView so it has "lazy loading".
The
> children of an expanded TreeItem shall be calculated when the item is set
to
> the expanded state. Is this possible wih the GEF TreeViewer? Where can I
add
> a listener which notifies about expanding/collapsing events?
>
> Thx in advance
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02957 seconds