Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 314677 - [modeling] Add "Collapse All" and "Expand All" buttons to the TreeViewer's toolbar
Summary: [modeling] Add "Collapse All" and "Expand All" buttons to the TreeViewer's to...
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: Incubators (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Benjamin Cabé CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-27 10:27 EDT by Jacques LESCOT CLA
Modified: 2010-06-17 04:25 EDT (History)
1 user (show)

See Also:


Attachments
Proposed patch defining a new style to configure buttons Options (2.59 KB, patch)
2010-05-27 10:28 EDT, Jacques LESCOT CLA
no flags Details | Diff
Support Expand/Collapse buttons - v2 (2.78 KB, patch)
2010-06-02 09:12 EDT, Jacques LESCOT CLA
no flags Details | Diff
mylyn/context/zip (938 bytes, application/octet-stream)
2010-06-16 12:26 EDT, Benjamin Cabé CLA
no flags Details

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