Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 314677

Summary: [modeling] Add "Collapse All" and "Expand All" buttons to the TreeViewer's toolbar
Product: [Eclipse Project] PDE Reporter: Jacques LESCOT <jlescot>
Component: IncubatorsAssignee: Benjamin Cabé <contact>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: contact
Version: 3.6   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Proposed patch defining a new style to configure buttons Options
none
Support Expand/Collapse buttons - v2
none
mylyn/context/zip none

Description Jacques LESCOT CLA 2010-05-27 10:27:15 EDT
These actions are particularly useful when the tree displays many elements using a deep hierarchy : it could be a good way to reset the tree contents to its initial state (all elements are collapsed) or to quickly expand all elements to explore the whole contents of the tree.

I propose to define a new style in the EmfMasterDetailBlock class that will be used to configure the buttons so that the user can have these buttons visible in the TreeViewer's toolbar.
Comment 1 Jacques LESCOT CLA 2010-05-27 10:28:23 EDT
Created attachment 170188 [details]
Proposed patch defining a new style to configure buttons Options
Comment 2 Jacques LESCOT CLA 2010-05-27 10:33:51 EDT
The collapse.gif and expand.gif images could be retrieved from existing Eclipse projects or directly from the following URLs:
- http://iconlet.com/info/18660_collapse_16x16
- http://iconlet.com/info/20380_expandall_16x16
Comment 3 Jacques LESCOT CLA 2010-06-02 09:12:09 EDT
Created attachment 170793 [details]
Support Expand/Collapse buttons - v2

New patch with minor improvements : use setRedraw(false) and setRedraw(true) to avoid unnecessary UI updates while the tree is being expanded/collapsed.
Comment 4 Benjamin Cabé CLA 2010-06-16 12:26:14 EDT
FIXED in HEAD > 20100616
Thanks Jacques ;)
Comment 5 Benjamin Cabé CLA 2010-06-16 12:26:16 EDT
Created attachment 172054 [details]
mylyn/context/zip
Comment 6 Jacques LESCOT CLA 2010-06-17 03:21:14 EDT
Benjamin, you simply forget to add the two icons ("collapse.gif" and "expand.gif") in the "icons/obj16" folder.
Comment 7 Benjamin Cabé CLA 2010-06-17 04:25:26 EDT
Oops, done.