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
IJavaElement	javaElement;
		int			scope;
		IWorkingSet	 	workingSet;
		
		public SearchPatternData(int s, int l, String p, IJavaElement element) {
			this(s, l, p, fIsCaseSensitive || element != null, element, ISearchPageContainer.WORKSPACE_SCOPE, null);
		}
		
		public SearchPatternData(int s, int l, String p, boolean i, IJavaElement element, int scope, IWorkingSet workingSet) {
			searchFor= s;
			limitTo= l;
			pattern= p;
			isCaseSensitive= i;
			javaElement= element;
			this.scope= scope;
			this.workingSet= workingSet;
		}
	}
	
	
	public boolean performAction() {
		SearchUI.activateSearchResultView();
		SearchPatternData data= getPatternData();
		IWorkspace workspace= JavaPlugin.getWorkspace();
		
		IJavaSearchScope scope= null;
		String scopeDescription= ""; 
		switch (getContainer().getSelectedScope()) {
			case ISearchPageContainer.WORKSPACE_SCOPE:
				scopeDescription= SearchMessages.getString("WorkspaceScope");