Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Preserve tree selection while collapsing/expanding a tree
Preserve tree selection while collapsing/expanding a tree [message #508821] Wed, 20 January 2010 13:34 Go to next message
philipp huebner is currently offline philipp huebnerFriend
Messages: 65
Registered: July 2009
Member
Hi folks,

I'm looking for a way to keep the selection of a tree when it's collapsed.
I couldn't found a flag or something and realized that Eclipse itself behaves also like this.
I think the usual tree implemetation should seperate a click onto the expander, a click onto the checkbox and the selection of an item,

Is there a way to get this behaviour easy?


Re: Preserve tree selection while collapsing/expanding a tree [message #509173 is a reply to message #508821] Thu, 21 January 2010 15:05 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Hi,

The behaviour you're currently seeing is native, so there is not an easy way
to change it to preserve selection in collapsed trees. You may be able to
implement this manually by listening on the Tree for Selection, Expand and
Collapse events, and programmatically selecting previously-selected items
when their ancestors become expanded. Whether it's worth doing the extra
work to implement this non-native behaviour is dependent on your app and the
role being played by the Tree.

Grant


"philipp huebner" <philipp.huebner@teraport.de> wrote in message
news:hj70pi$m3$1@build.eclipse.org...
> Hi folks,
>
> I'm looking for a way to keep the selection of a tree when it's collapsed.
> I couldn't found a flag or something and realized that Eclipse itself
behaves also like this.
> I think the usual tree implemetation should seperate a click onto the
expander, a click onto the checkbox and the selection of an item,
>
> Is there a way to get this behaviour easy?
>
>
>
Previous Topic:Using PropertyView
Next Topic:Re: Customizing Traverse-keys for ColumnViewerEditor
Goto Forum:
  


Current Time: Thu Apr 25 17:05:07 GMT 2024

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

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

Back to the top