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
match.isCaseSensitive= fCaseSensitive.getSelection();
			match.javaElement= fJavaElement;
			match.scope= getContainer().getSelectedScope();
			match.workingSet= getContainer().getSelectedWorkingSet();
		};
		return match;
	}
	/*
	 * Implements method from IDialogPage
	 */
	public void setVisible(boolean visible) {
		if (visible && fPattern != null) {
			if (fFirstTime) {
				fFirstTime= false;
				
				fPattern.setItems(getPreviousSearchPatterns());
				initSelections();
			}
			fPattern.setFocus();
			getContainer().setPerformActionEnabled(fPattern.getText().length() > 0 && getContainer().hasValidScope());
		}
		super.setVisible(visible);
	}
	
	public boolean isValid() {
		return true;
	}
	
	/**
	 * Creates the page's content.