Bug 64921 members view: selection of a member does not give proper selection change events [browsing]
RC1 - browsing perspective, smoke test scenario - to make the problem visible, enable "Mark occurrences" - open IMoney.java - in the members view, double click on a not selected element -> ok: the member is selected in the editor, focus is transferred to the editor, the element gets highlighted (-> selection changed event was sent out) - now select a different element in the members view (no double click!) -> ? ok ? The element gets selected in the editor, but it is not highlighted (may be on purpose, since the editor is not active). -> not ok: if I double click now, the focus is transferred to the editor, but the highlighting is not updated. This is because the selection has not changed and no event is therefore sent out. The question is really whether selection without giving focus should trigger a selection changed event in the editor.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/SelectionListenerWithASTManager.java
protected void doSelectionChanged(IWorkbenchPart part, ISelection selection) {
			if (part instanceof IEditorPart && selection instanceof ITextSelection) { 
				PartListenerGroup listenerGroup= (PartListenerGroup) fPartListeners.get(part);
				if (listenerGroup != null) {
					listenerGroup.fireSelectionChanged((ITextSelection) selection);
				}
			}
		}	
	}
	
	private Map fListenerGroups;
	
	private SelectionListenerWithASTManager() {
		fListenerGroups= new HashMap();
	}
	
	/**
	 * Registers a selection listener for the given editor part. 
	 * @param part The editor part to listen to.
	 * @param listener The listener to register.
	 */
	public void addListener(IEditorPart part, ISelectionListenerWithAST listener) {
		ISelectionService service= part.getSite().getWorkbenchWindow().getSelectionService();
		WorkbenchWindowListener windowListener= (WorkbenchWindowListener) fListenerGroups.get(service);
		if (windowListener == null) {
			windowListener= new WorkbenchWindowListener(service);
			fListenerGroups.put(service, windowListener);
		}
		windowListener.install(part, listener);