Is there a way to open the JFace ElementTreeSelectionDialog unfolded?

Go To StackoverFlow.com

2

as the title already says... I'd like to open a ElementTreeSelectionDialog with the Tree already unfolded. Is there any way?

Regards, Michael

2012-04-04 18:21
by Michael


5

The ElementTreeSelectionDialog doesn't have this capability out of the box, but you can easily extend it to add this behavior. Simply subclass it and override the createTreeViewer method. After calling super version of this method, you will have a handle on initialized TreeViewer for the dialog. At that point, it is simply a matter of using TreeViewer.setExpanded() or TreeItem.setExpanded() API to expand as little or as much as you'd like.

2012-04-04 18:53
by Konstantin Komissarchik
Ads