Bug 68011 [java search] "Search the JRE System Libraries" looks like a local preference but behaves as a global one... [search]
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchScopeFactory.java
return createJavaProjectSearchScope(project, includeJRE);
			}
		}
		return EMPTY_SCOPE;
	}
	
	public String getProjectScopeDescription(IJavaProject project) {
		return Messages.format(SearchMessages.ProjectScope, project.getElementName()); 
	}
	
	public String getProjectScopeDescription(IEditorInput editorInput) {
		IJavaElement elem= JavaUI.getEditorInputJavaElement(editorInput);
		if (elem != null) {
			IJavaProject project= elem.getJavaProject();
			if (project != null) {
				return getProjectScopeDescription(project);
			}
		}
		return Messages.format(SearchMessages.ProjectScope, "");  
	}
	
	
	public IProject[] getProjects(IJavaSearchScope scope) {
		IPath[] paths= scope.enclosingProjectsAndJars();
		HashSet temp= new HashSet();
		for (int i= 0; i < paths.length; i++) {
			IResource resource= ResourcesPlugin.getWorkspace().getRoot().findMember(paths[i]);
			if (resource != null && resource.getType() == IResource.PROJECT)
				temp.add(resource);
		}