Bug 10577 Java Search: search scope "Selected resource" not working
Switch to new StructuredSelectionProvider intruduced this bug a) because the provider does not do code resolve if the input is not a selection service b) because at the time the selection service is asked for the selection it takes the selection form the newly opened Search view
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
}
	
	/**
	 * Returns the current active selection.
	 */
	private ISelection getSelection() {
		IWorkbenchWindow wbWindow= PlatformUI.getWorkbench().getActiveWorkbenchWindow();
		if (wbWindow == null)
			return fContainer.getSelection();
		StructuredSelectionProvider provider= StructuredSelectionProvider.createFrom(wbWindow.getSelectionService());
		ISelection selection= provider.getSelection();
		if (selection.equals(StructuredSelection.EMPTY))
			return fContainer.getSelection();
		else
			return selection;
	}
	
	/**
	 * Returns the current active editor part.
	 */
	private IEditorPart getEditorPart() {
		IWorkbenchWindow window= JavaPlugin.getActiveWorkbenchWindow();
		if (window != null) {
			IWorkbenchPage page= window.getActivePage();
			if (page != null)
				return page.getActiveEditor();
		}
		return null;
	}