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

Bug 325250

Summary: [type hierarchy] Improve label in history dropdown for Multi-select Java elements and show in Type Hierarchy
Product: [Eclipse Project] JDT Reporter: Deepak Azad <deepakazad>
Component: UIAssignee: Raksha Vasisht <raksha.vasisht>
Status: VERIFIED FIXED QA Contact:
Severity: minor    
Priority: P2 CC: daniel_megert, rthakkar
Version: 3.7   
Target Milestone: 3.7 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
screenshot
none
Patch none

Description Deepak Azad CLA 2010-09-14 09:39:05 EDT
Steps
- Select 5 java elements in PE 
- Press F4
- In the Type Hierarchy view the history dropdown shows only 2 java elements. Also the entries can become quite difficult to read, depending on resolution, platform etc (See attachment, this is from a Kubuntu machine).

Possible improvements
- The label should show '... 3 more' or at least ',...' (search view also uses the second option)
- Maybe each element can be enclosed in parenthesis? e.g. (TypeA - o.e.jdt) , (TypeB - o.e.jdt)
- And to really push it the dropdown should respect package name abbreviation preferences to make the label more readable ;-)
Comment 1 Deepak Azad CLA 2010-09-14 09:39:30 EDT
Created attachment 178830 [details]
screenshot
Comment 2 Dani Megert CLA 2010-09-14 10:26:44 EDT
We should use the same approach as in Search.
Comment 3 Dani Megert CLA 2010-09-14 10:28:03 EDT
And that's actually what I already suggested in the original bug:
> We should limit the label rendering to 2 elements like in the Search view.

and which got marked as 'Done' ;-)
Comment 4 Raksha Vasisht CLA 2010-09-15 12:32:24 EDT
(In reply to comment #3)
> And that's actually what I already suggested in the original bug:
> > We should limit the label rendering to 2 elements like in the Search view.
> 
> and which got marked as 'Done' ;-)

It was limited to 2 elements ;) and the comment was 
 > Done. Could be improved by addding a '...' if needed. ;)


Added '' to each element and a '- in' before working set. Hope its more clear now.

Changes to the below files committed to HEAD : 
org.eclipse.jdt.internal.ui.typehierarchy.HistoryAction
org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyMessages.java
/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyMessages.properties
Comment 5 Dani Megert CLA 2010-09-16 02:41:43 EDT
Verified that '...' is now shown. There are some issues with this though:
1. the single quotes are missing if there's just one element
2. the elements are concatenated in the code which is a no go
3. the HistoryAction.concatenateElementsNames(IJavaElement[], long) looks way
   too complicated to me

Also, filed bug 325408 for the inconsistency in Call Hierarchy.

Please polish right after M2.
Comment 6 Raksha Vasisht CLA 2010-09-20 15:41:06 EDT
Created attachment 179275 [details]
Patch

(In reply to comment #5)
> Verified that '...' is now shown. There are some issues with this though:
> Please polish right after M2.

Removed HistoryAction.concatenateElementsNames(IJavaElement[], long) and used getElementLabel(..) instead everywhere. Fixed quotes for single element as well and consistency in History drop down and History dialog. 

Patch committed to HEAD.
Comment 7 Raksha Vasisht CLA 2010-09-21 01:38:08 EDT
.
Comment 8 Dani Megert CLA 2010-09-21 03:24:56 EDT
Much better :-)
Comment 9 Rajesh CLA 2010-10-26 08:19:11 EDT
Verified in I20101025-1800.