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
private IJavaElement fJavaElement;
	private boolean fFirstTime= true;
	private IDialogSettings fDialogSettings;
	private boolean fIsCaseSensitive;
	
	private Combo fPattern;
	private ISearchPageContainer fContainer;
	private Button fCaseSensitive;
	
	private Button[] fSearchFor;
	private String[] fSearchForText= {
		SearchMessages.getString("SearchPage.searchFor.type"), 
		SearchMessages.getString("SearchPage.searchFor.method"), 
		SearchMessages.getString("SearchPage.searchFor.package"), 
		SearchMessages.getString("SearchPage.searchFor.constructor"), 
		SearchMessages.getString("SearchPage.searchFor.field")}; 
	private Button[] fLimitTo;
	private String[] fLimitToText= {
		SearchMessages.getString("SearchPage.limitTo.declarations"), 
		SearchMessages.getString("SearchPage.limitTo.implementors"), 
		SearchMessages.getString("SearchPage.limitTo.references"), 
		SearchMessages.getString("SearchPage.limitTo.allOccurrences"), 
		SearchMessages.getString("SearchPage.limitTo.readReferences"), 		
		SearchMessages.getString("SearchPage.limitTo.writeReferences")}; 
	
	private class SearchPatternData {
		int			searchFor;
		int			limitTo;
		String			pattern;
		boolean		isCaseSensitive;