|generate the sub tree from tree [message #636828]
||Wed, 03 November 2010 02:02
Registered: July 2010
I dont know weather it is possible are not ? but still i want to know answer..
I checkbox tree viewer.. now i will select few node from from check box tree viewer... now i want to generate the tree
same hiearchy with only selected nodes.
[Updated on: Wed, 03 November 2010 02:02]
Report message to a moderator
|Re: generate the sub tree from tree [message #636857 is a reply to message #636828]
||Wed, 03 November 2010 07:20
| Daniel KrÃ¼gler
Registered: July 2009
On 03.11.2010 03:02, email@example.com wrote:|
> Hi all.
> I dont know weather it is possible are not ? but still i know answer..
> I checkbox tree viewer.. now i will select few node from from check box
> tree viewer... now i want to generate the tree same hiearchy with only
> selected nodes.
Untested: You might try to add a temporary ViewerFilter that is
activated, when you need that (you don't describe this situation very
clearly). The filter would only accept those elements, which are
selected. You can use the IStructuredSelection result of the viewer for
If you don't want to filter the original tree, but want to have an
independent viewer, you can do the same thing, but provide a seperate
Viewer with the same input, but with the filter that I described above.
The referenced IStructuredSelection object is that of the first tree,
If you need a complete independent copy of the tree *model*, you can
also follow this route, but slightly different: Use a standard algorithm
to copy a tree, but while doing so, check for each added element whether
it is member of the IStructuredSelection object of the reference tree.
If not, don't copy this particular element.
HTH & Greetings from Bremen,
Powered by FUDForum
. Page generated in 0.01431 seconds