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

Bug 55853

Summary: [browsing] Packages view: try to restore selection after input change
Product: [Eclipse Project] JDT Reporter: Alex Blewitt <alex.blewitt>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: minor    
Priority: P3 CC: andre_weinand, daniel_megert, martinae, simon
Version: 3.0   
Target Milestone: ---   
Hardware: Macintosh   
OS: All   
Whiteboard: stalebug
Bug Depends on: 34612    
Bug Blocks:    
Attachments:
Description Flags
Project with many packages
none
Normal view of packages scrolled to bottom
none
Changing to a different source package
none
Manually scrolling upwards to bottom of list none

Description Alex Blewitt CLA 2004-03-24 05:28:38 EST
I was editing in a 'Java Browsing' perspective a project with multiple source folders and multiple 
packages. I had scrolled down to the bottom of the package list, and then selected a different source 
folder (so that there were much fewer packages visible). However, the packages list did not auto-scroll 
upwards to highlight the same package; instead, it stayed at the same 'scroll location' with the result it 
was full of blank space.

Ideally, when selecting different source folders, the package view should reposition itself so that the 
original package is both still selected and stil visible on the screen. However, in any case the list should 
not be displayed as a complete blank.

Will submit screenshots for more explaination.
Comment 1 Alex Blewitt CLA 2004-03-24 05:32:20 EST
Created attachment 8814 [details]
Project with many packages
Comment 2 Alex Blewitt CLA 2004-03-24 05:33:13 EST
Created attachment 8815 [details]
Normal view of packages scrolled to bottom
Comment 3 Alex Blewitt CLA 2004-03-24 05:33:46 EST
Created attachment 8817 [details]
Changing to a different source package
Comment 4 Alex Blewitt CLA 2004-03-24 05:34:19 EST
Created attachment 8818 [details]
Manually scrolling upwards to bottom of list
Comment 5 Dirk Baeumer CLA 2004-03-24 09:14:11 EST
There are two issues here:

- the loss of the selection. We could try to restore the selection if we find
  a package with the same name.

- the not scrolling. The scrolling seems to be a Mac problem since this doesn't
  happen under Windows.

Andre, can you please comemnt on the scrolling problem

Daniel, can you comment on the selection loss.
Comment 6 Andre Weinand CLA 2004-03-24 09:35:33 EST
The "not scrolling problem" is a duplicate of bug #34612 
Comment 7 Alex Blewitt CLA 2004-03-24 09:39:24 EST
Andre, can you change the title to bug #34612 to be 'scroll tree and list' -- I did a search for the bug 
(because I'd thought I'd seen it somewhere before) but it didn't come up. I have asked on 34612 for the 
title to be changed previously, but to no avail. (Hence accidentally submitting that part dup).
Comment 8 Dani Megert CLA 2004-03-24 09:45:54 EST
Adapting summary to reflect the remaining issue: Packages view should try to
restore the previous selection after changing input.
Comment 9 Martin Aeschlimann CLA 2006-06-15 02:56:01 EDT
Is this last issue still wanted? Is it common that a different source folder has the same package?
Comment 10 Alex Blewitt CLA 2006-06-15 03:08:26 EDT
Very often the case that two source folders will have the same package. For example, almost all of my projects have a 'Source' and a 'Test' folder which allows me to separate out unit testing code from real code. All of the test classes live in the same package as the the code that they're testing; primarily as a way of helping to organise them, but also so that package-level members can be accessed as well.

I don't believe this is common inside Eclipse.org because you guys use a separate feature-test plugin for holding all the test code for your plugins for a specific feature (e.g. jdt-tests). But even in plugin development, one may still use two source folders to store test/non-test code inside the same plugin; the automated build process can then be tweaked to not include the test code for final output, or compiled into a separate fragment for inclusion during testing.

Maven-organised projects almost always have two source folders; one for test, one for source in the same project. And like I said, the convention does tend to be for them to be named the same as the code that they're testing.

This is a nice-to-have feature, but it's still nice to have :-)
Comment 11 Dani Megert CLA 2006-06-15 06:19:58 EDT
This is actually a bug. We should either

completely ignore the previous selection and make sure the first item is on top and also the vertical scrollbar is at the top

or try to reveal the original selection and then also select that element in the list. Revert to first behavior if the original selection is not in the list.
Comment 12 Eclipse Genie CLA 2020-04-03 17:44:11 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.