Community
Participate
Working Groups
Created attachment 178833 [details] project Project structure Test -src1 ---p -----A.java -src2 ---p -----B.java - Use attached project or create one with the above structure - Open 'Packages' view - Open Type hierarchy view on package 'p' => the entry in history dropdown is - 'p - Test/src2' It should either list all source folders the package is found in, or none at all.
>It should either list all source folders the package is found in, or none at >all. Agreed. It should look like the label in the status line (see org.eclipse.jdt.internal.ui.browsing.PackagesView.StatusBarUpdater4LogicalPackage).
That's a problem we already had before we supported multiple packages. I'll move this bug to M3. I would even close it as WONTFIX. Too many hacks for a contrived use case.
>Too many hacks for a contrived use case. Mmh, really? Shouldn't be that many: we only need to do this if all the selected elements are package fragments with the same name and project.
Created attachment 179002 [details] Patch (In reply to comment #3) > >Too many hacks for a contrived use case. > Mmh, really? Shouldn't be that many: we only need to do this if all the > selected elements are package fragments with the same name and project. Nope. The issue is when OTH is invoked on a LP selected from the packages view, it shows the fragments as separate input elements with different qualifiers and when one of them is selected from the PE and the OTH action is invoked, the label shows only that package fragment which cannot be verified as Logical Package easily. Also the selections can be a LP and other elements in which case the packages forming the LP should be added only once and then label of the next element also needs to be added. I had a fix (written for M2) with not too many changes to existing code: 1) disable qualifiers for more than one selection or any selection of packages 2) if multi-selection, check for the packages with same name and project and add label only once Could also be improved by adding special qualifier code only for LP showing all the parent paths.. but again checking whether 2 or more packages form a LP and that they could be anywhere in the selection is what would make too many hacks.
>(In reply to comment #3) >> >Too many hacks for a contrived use case. >> Mmh, really? Shouldn't be that many: we only need to do this if all the >> selected elements are package fragments with the same name and project. >Nope. Well I disagree. The only case we want to solve is the selection of a logical package. This can be easily detected. Also, the initial comment 0 is either wrong (not for 'Packages' view but for 'Package Explorer') or the code in HEAD is now different. In addition the rendering in the history menu differs from the history dialog which we definitely need to fix.
We first have to figure out the scenarios and the expected result before we start to discuss how complex a solution is.
We have the following problems which we should fix (nothing else): 1. In the case where we select a single package 'p' in the Package Explorer (PE) the Type Hierarchy (TH) shows the types for all packages 'p' in the same project. That's old behavior which we won't touch. However, in this case we only show the path for the selected package (same bug in 3.6). I think the simplest way to fix this is to move the code that collects the logical package from the THLifeCycle.createTypeHierarchy(...) to the OpenTHAction. This will make sure that all packages are part of the input for the TH and automatically rendered like any other multi-selection. 2. The labels in the history drop down and the history dialog don't match if more than one element is selected: the menu shows the path while the dialog does not.
Note that after fixing problem 1 from previous comment, it will also show 'p', 'p' in the view's description area, indicating to the user that two packages were used as input.
Created attachment 179291 [details] Patch (In reply to comment #7) > We have the following problems which we should fix (nothing else): > 1. In the case where we select a single package 'p' in the Package Explorer > (PE) > the Type Hierarchy (TH) shows the types for all packages 'p' in the same > project. That's old behavior which we won't touch. However, in this case > we only show the path for the selected package (same bug in 3.6). I think > the simplest way to fix this is to move the code that collects the logical > package from the THLifeCycle.createTypeHierarchy(...) to the OpenTHAction. > This will make sure that all packages are part of the input for the TH and > automatically rendered like any other multi-selection.> Moved code that collects LP to OpenTypeHierarchyAction.java. Shows separate labels for each fragment of a LP everywhere. > 2. The labels in the history drop down and the history dialog don't match if > more than one element is selected: the menu shows the path while the dialog > does not. Fixed with bug 325250.
.
> Created an attachment (id=179291) [details] [diff] > Patch Patch committed to HEAD.
Verified in I20101025-1800.