public IProject[] getJavaProjects(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);
private Set getJavaProjects(ISelection selection) { Set javaProjects; if (selection instanceof IStructuredSelection && !selection.isEmpty()) { Iterator iter= ((IStructuredSelection) selection).iterator(); javaProjects= new HashSet(((IStructuredSelection) selection).size()); while (iter.hasNext()) { Object selectedElement= iter.next();   if (selectedElement instanceof ISearchResultViewEntry) selectedElement= ((ISearchResultViewEntry) selectedElement).getGroupByKey();  if (selectedElement instanceof LogicalPackage)  javaProjects.add(((LogicalPackage) selectedElement).getJavaProject()); else if (selectedElement instanceof IAdaptable) { IJavaProject javaProject= getJavaProject((IAdaptable) selectedElement); if (javaProject != null) javaProjects.add(javaProject); } } } else { javaProjects= EMPTY_SET;
	public IProject[] getJavaProjects(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);		}		return (IProject[]) temp.toArray(new IProject[temp.size()]);	}