Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 274091 - [call hierarchy] Wrong behavior of Expand With Constructors on multi-selection with parent/child
Summary: [call hierarchy] Wrong behavior of Expand With Constructors on multi-selectio...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.5 M7   Edit
Assignee: Raksha Vasisht CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-28 11:39 EDT by Dani Megert CLA
Modified: 2009-04-30 03:09 EDT (History)
1 user (show)

See Also:


Attachments
FIX (4.07 KB, patch)
2009-04-29 06:26 EDT, Raksha Vasisht CLA
markus.kell.r: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2009-04-28 11:39:46 EDT
I20090428-0100.

When having a multi-selection of children (not siblings) in the Call Hierarchy the behavior of 'Expand With Constructors' is wrong: it only applies it on the first selected item.

Either we should not offer the action in this case or we apply the state to all selected elements, so that when I later expand one of the callers I get the constructors as well.

NOTE: multi-selection on siblings works as expected.
Comment 1 Dani Megert CLA 2009-04-28 12:09:12 EDT
I guess disabling is better and probably simpler at this point.

Markus?
Comment 2 Markus Keller CLA 2009-04-28 12:39:29 EDT
> I guess disabling is better and probably simpler at this point.

I agree. Furthermore, I don't think anybody would miss the possibility to toggle a parent together with a child. If you toggle a parent, this indicates that you're not (primarily) interested in the direct callers, so why should you select one of them and then want to see its constructor calls?
Comment 3 Dani Megert CLA 2009-04-29 02:32:54 EDT
>so why should you
>select one of them and then want to see its constructor calls?
Maybe because I have more than one root node expanded and then 'Select All' plus checking the pref is faster than selecting individual nodes. But as said in comment 1 I'm also for disabling ;-)

Raksha, can you provide us with a patch today?
Comment 4 Raksha Vasisht CLA 2009-04-29 06:26:41 EDT
Created attachment 133738 [details]
FIX

The EWC action is now disabled for parent-child selection at any level. If any one of the selected elements is a parent/child of the other elements at any level , then the action is not added to the menu. 

Also cleaned up the code in ExpandWithConstructorsAction.getSelectedInputElements() and added the logic it to ExpandWithConstructorsAction.run().
Comment 5 Markus Keller CLA 2009-04-29 09:59:16 EDT
Thanks, released to HEAD.
Comment 6 Dani Megert CLA 2009-04-30 03:09:22 EDT
Verified in I20090429-1800.