Bug 5052 Scrolling to the top of page when synching packages view
Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
fDeleteAction.update();
			if (fDeleteAction.isEnabled())
				fDeleteAction.run();
		}	
	}
	
	/**
	 * Handles double clicks in viewer.
	 * Opens editor if file double-clicked.
	 */
	private void handleDoubleClick(DoubleClickEvent event) {
		IStructuredSelection s= (IStructuredSelection) event.getSelection();
		Object element= s.getFirstElement();
		
		
		if (EditorUtility.isOpenInEditor(element) == null) {
			if (fOpenCUAction.isEnabled()) {
				fOpenCUAction.run();
				return;
			}
		}
		if (fViewer.isExpandable(element)) {
			if (JavaBasePreferencePage.doubleClockGoesInto())
				fZoomInAction.run();
			else {
				fViewer.setExpandedState(element, !fViewer.getExpandedState(element));
				expandMainType(element);
			}
		}
	}