if (selection != null && !selection.isEmpty()) input= getSingleElementFromSelection(selection); else {
if (selection == null || selection.isEmpty()) {
	protected void setInitialSelection() {		// Use the selection, if any		Object input;		IWorkbenchPage page= getSite().getPage();		ISelection selection= null;		if (page != null)			selection= page.getSelection();		if (selection instanceof ITextSelection) {			Object part= PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();			if (part instanceof IEditorPart) {				setSelectionFromEditor((IEditorPart)part);				if (fViewer.getSelection() != null)					return;			}		}		// Use saved selection from memento		if (selection == null || selection.isEmpty())			selection= restoreSelectionState(fMemento);					if (selection != null && !selection.isEmpty())			input= getSingleElementFromSelection(selection);		else {			// Use the input of the page			input= getSite().getPage().getInput();			if (!(input instanceof IJavaElement)) {				if (input instanceof IAdaptable)					input= ((IAdaptable)input).getAdapter(IJavaElement.class);				else					return;			}		}		if (findElementToSelect((IJavaElement)input) != null)			adjustInputAndSetSelection((IJavaElement)input);	}