[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: TreeItem expansion strategy

Sound like correct behavior to me. If the parent has no children, how can it 
expand to show what it doesn't have?

I realize you want setExpanded to end up like a flag on the folder so when 
stuff is added to it, it knows it's supposed to be expanded and does so.

If you use a TreeViewer with content providers and such, you could create 
your own listeners on the treenode objects that could do it the way you 
wanted. Simply store an expanded boolean flag on the node, and when children 
get added you check to see if it's true, and then expand.

Hope that helps.

Emil

"Max Rotvel" <rotvel@xxxxxxxxxxxxxxxxxx> wrote in message 
news:op.spv7wzkp94ko3h@xxxxxxxxxxxxxxxx
>I have a two-layered Tree where I want all the topitems to be expanded
> at creation time.
>
> If I call setExpanded(true) on the topitems, before adding the subitems,
> they are not expanded. If I call setExpanded(true) after adding the
> subitems, the topitems are expanded properly.
>
> Is this behaviour intentional? unavoidable? a bug?
>
> Regards
> -- 
>  Max  - rotvel AT bolignet-aarhus DOT dk