Bug 160977

Summary: [Viewers] TreeViewer should provide API to initially Expand Elements
Product: [Eclipse Project] Platform Reporter: Benjamin Pasero <bpasero>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: bradleyjames, lafeuil, tom.schindl
Version: 3.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Benjamin Pasero CLA 2006-10-15 12:14:19 EDT
Correct me if I am wrong, but the current API of AbstractTreeViewer is only providing the Auto-Expand-Level in order to initially have Nodes expanded upon Tree-Creation.

Considering that only some elements should show as expanded, you have to first create the Tree and then call setExpandedElements(). 

I think it would make sense to provide additional API that allows to define which Nodes are expanded, before the Tree is actually created (similiar to the auto-expand level, but on a element-level and not hierachy-level).

Maybe this could be a callback in the Viewer (isExpanded(Object element)) ?

Ben
Comment 1 Boris Bokowski CLA 2006-10-19 14:40:57 EDT
Do you have a concrete use case in mind?
Comment 2 Benjamin Pasero CLA 2006-10-19 15:39:56 EDT
Sure. In my product I am providing a "Grouping"-Mode for the Table I show (in fact its a Tree by then). This grouped mode is pretty much looking like in Eclipse when you enable grouping for the Problems-View. Now if you provide such groups, you have to decide wether to show them collapsed or expanded initially. Either way is not very userfriendly, so ideally you would remember the state of expanded groups from the last time the user worked with it. This includes the situation where the user only expanded the first TreeItem and left the others collapsed.

Ben
Comment 3 Boris Bokowski CLA 2009-11-26 09:51:18 EST
Hitesh is now responsible for watching bugs in the [Viewers] component area.