Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 322538 - [call hierarchy] "Expand with Constructors" should auto-expand single constructor
Summary: [call hierarchy] "Expand with Constructors" should auto-expand single constru...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.7 M2   Edit
Assignee: Raksha Vasisht CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-12 10:37 EDT by Markus Keller CLA
Modified: 2010-09-14 12:21 EDT (History)
2 users (show)

See Also:
markus.kell.r: review+


Attachments
patch (4.60 KB, patch)
2010-08-15 16:23 EDT, Raksha Vasisht CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2010-08-12 10:37:12 EDT
The "Expand with Constructors" action in the Call Hierarchy should auto-expand the "[constructor] ..." node if there is only one. There's a 99% chance that the user wants to expand this constructor after choosing the action.

I would also try how it feels if we do the same when a node is automatically expanded with constructors due to the view settings. I think it could be convenient too, but it could also become confusing.
Comment 1 Raksha Vasisht CLA 2010-08-15 16:23:38 EDT
Created attachment 176643 [details]
patch

Yes, I agree that the constructor node should automatically expand once 'Expand with Constructor' action is chosen and there is only one constructor, and to make the behaviour uniform I would make it the same way when the method/type is in the list to be expanded with constructors as well. Markus, is this what you had in mind?
Comment 2 Markus Keller CLA 2010-08-27 08:14:53 EDT
Looks good, but I would rename CallHierarchyViewer#fConstructorMethodWrapper to fConstructorToExpand (and rename the setter as well).

If you make the two other fields final and add an empty line in front of fConstructorMethodWrapper, then is much easier to understand that this field only keeps temporary state but the others are real properties of the viewer.
Comment 3 Raksha Vasisht CLA 2010-08-31 01:58:34 EDT
(In reply to comment #2)
> Looks good, but I would rename CallHierarchyViewer#fConstructorMethodWrapper to
> fConstructorToExpand (and rename the setter as well).
> 
> If you make the two other fields final and add an empty line in front of
> fConstructorMethodWrapper, then is much easier to understand that this field
> only keeps temporary state but the others are real properties of the viewer.

Patch committed to HEAD with above changes.
Comment 4 Deepak Azad CLA 2010-09-14 11:12:34 EDT
Verified for 3.7M2 on Linux with I20100914-0100.
Comment 5 Rajesh CLA 2010-09-14 12:21:28 EDT
Verified for 3.7 M2 with I20100913-1800.