Bug 160977 - [Viewers] TreeViewer should provide API to initially Expand Elements
Summary: [Viewers] TreeViewer should provide API to initially Expand Elements
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-15 12:14 EDT by Benjamin Pasero CLA
Modified: 2012-11-28 08:58 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.