if (newInput != null && newInput.equals(currentInput)) { IJavaElement elementToSelect= findElementToSelect(getElementFromSingleSelection(selection)); if (elementToSelect != null && getTypeComparator().compare(newInput, elementToSelect) < 0)
if (selectedElement != null && selectedElement.equals(currentInput)) { IJavaElement elementToSelect= findElementToSelect(getSingleElementFromSelection(selection)); if (elementToSelect != null && getTypeComparator().compare(selectedElement, elementToSelect) < 0)
	public void selectionChanged(IWorkbenchPart part, ISelection selection) {				if (!fProcessSelectionEvents || part == this || !(selection instanceof IStructuredSelection))			return;					if (selection.isEmpty() && part instanceof JavaBrowsingPart && !(part instanceof ProjectsView))			return;				// Set input		Object newInput= getElementFromSingleSelection(selection);		Object currentInput= (IJavaElement)getViewer().getInput();		if (newInput != null && newInput.equals(currentInput)) {			IJavaElement elementToSelect= findElementToSelect(getElementFromSingleSelection(selection));			if (elementToSelect != null && getTypeComparator().compare(newInput, elementToSelect) < 0)				setSelection(new StructuredSelection(elementToSelect), true);			fPreviousSelectionProvider= part;			return;		}		// Clear input if needed		if (part != fPreviousSelectionProvider && newInput != null && !newInput.equals(currentInput) && isInputResetBy(newInput, currentInput, part)) {			if (!isAncestorOf(newInput, currentInput))				setInput(null);			fPreviousSelectionProvider= part;			return;		} else if (newInput == null && part == fPreviousSelectionProvider) {			setInput(null);			fPreviousSelectionProvider= part;			return;		}		fPreviousSelectionProvider= part;				// Set selection		if (newInput instanceof IJavaElement)			adjustInputAndSetSelection((IJavaElement)newInput);		else			setSelection(StructuredSelection.EMPTY, true);	}