Bug 80419 - [Call Hierarchy] allow multiple select>Copy to Clipboard
Summary: [Call Hierarchy] allow multiple select>Copy to Clipboard
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-07 15:58 EST by Tom Roche CLA
Modified: 2004-12-09 05:32 EST (History)
1 user (show)

See Also:


Attachments
a sample CH view, used in comment 3 (38.12 KB, image/jpeg)
2004-12-08 15:27 EST, Tom Roche CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Roche CLA 2004-12-07 15:58:03 EST
usecase: I wanna change a method, but need to assess the risk and
assure others, so I want to write out something describing

* who uses that method

* how they would need to change (if at all)

I know I can get the users of a method from Call Hierarchy, so I
select the method and C-A-h. Unfortunately the method is widely used,
so CH returns many items in its treeview.

problem: when I try to shift-click them all, in order to do Copy to
Clipboard, I only succeed in selecting the final item. Instead I am
required to do

for each item of interest
  select it
  right-click>Copy to Clipboard
  paste into document

solution:

* allow selection of multiple items in CH

* allow Copy to Clipboard to be an operation on multiple items in CH,
  with results like the above for-loop.
Comment 1 Dirk Baeumer CLA 2004-12-08 05:53:44 EST
Markus, is there a reason why we don't support multi select ?
Comment 2 Markus Keller CLA 2004-12-08 06:45:50 EST
I don't see a reason why we could not support multiselect in the Call Hierarchy,
except for problems with the "Copy to Clipboard" action.

For the "Copy to Clipboard" action, there are two possible implementations:

A) *This is already implemented and works*. Copy the item text of the selected
node and all its expanded subnodes. Tom, you can just go one node up in the tree
and copy it while it is expanded.

B) Copy the item texts of those items which are currently selected in the tree.
This can become weird when items from different branches are selected, e.g.

	void m1() { }
	void mX() { m1(); }
	void mY() { m1(); }
	void m3() { mY(); }

... with m3() and mX() selected in the caller hierarchy:
m1() : void - p.A
    mY() : void - p.A
        m3() : void - p.A  <-- selected
    mX() : void - p.A      <-- selected

What would you expect in the clipboard? Something like this?
    m3() : void - p.A
mX() : void - p.A
Comment 3 Tom Roche CLA 2004-12-08 15:27:26 EST
Created attachment 16465 [details]
a sample CH view, used in comment 3
Comment 4 Tom Roche CLA 2004-12-08 15:29:27 EST
Comment #2 From Markus Keller  2004-12-08 06:45 -------
>> I don't see a reason why we could not support multiselect in the
>> Call Hierarchy, except for problems with the "Copy to Clipboard"
>> action.

>> For the "Copy to Clipboard" action, there are two possible
>> implementations:

>> A) *This is already implemented and works*. Copy the item text of
>> the selected node and all its expanded subnodes. Tom, you can just
>> go one node up in the tree and copy it while it is expanded.

Interesting! See a sample JPEG [sample80419.jpg]:

* if I collapse the top item
  (getDefaultSuperclassName(IActionRegionData)), select it, and
  rclick>Copy to Clipboard, I get

> getDefaultSuperclassName(IActionRegionData) -
com.ibm.etools.struts.wizards.wrf.WizardUtils

* if I expand the top item, select it (and only it), and rclick>Copy
  to Clipboard, I get

> getDefaultSuperclassName(IActionRegionData) -
com.ibm.etools.struts.wizards.wrf.WizardUtils
>   getDefaultSuperclassName(IStrutsRegionData) -
com.ibm.etools.struts.wizards.wrf.StrutsRegionDataPage
>   getActions() - com.ibm.etools.struts.wizards.actions.GenericActionRegionData
>   handleNewModelSelected(String) -
com.ibm.etools.struts.wizards.actions.GenericActionRegionDataPage
>   getDefaultSuperclassName(IActionMappingRegionData) -
com.ibm.etools.struts.wizards.wrf.WizardUtils

Useful to know, but perhaps you will agree that it is not particularly
intuitive?

>> B) Copy the item texts of those items which are currently selected
>> in the tree. This can become weird when items from different
>> branches are selected, e.g.

>>  void m1() { }
>>  void mX() { m1(); }
>>  void mY() { m1(); }
>>  void m3() { mY(); }

>> ... with m3() and mX() selected in the caller hierarchy:
>> m1() : void - p.A
>>     mY() : void - p.A
>>         m3() : void - p.A  <-- selected
>>     mX() : void - p.A      <-- selected

>> What would you expect in the clipboard? Something like this?
>>     m3() : void - p.A
>> mX() : void - p.A

Better yet (quoting added in order to illustrate "line up")

>>         m3() : void - p.A
>>     mX() : void - p.A

but the mechanism (indentation) would do nicely.
Comment 5 Markus Keller CLA 2004-12-09 05:32:30 EST
Renamed "Copy to Clipboard" to "Copy Expanded Hierarchy" and enabled
multiselection in the hierarchy tree.

The implementation of B) from comment 2 will need more work. Currently, the Copy
action (Ctrl+C) just copies the selected methods' names and parameter types