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

Bug 322538

Summary: [call hierarchy] "Expand with Constructors" should auto-expand single constructor
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: UIAssignee: Raksha Vasisht <raksha.vasisht>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: deepakazad, rthakkar
Version: 3.7Flags: markus.kell.r: review+
Target Milestone: 3.7 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch none

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.