Bug 10054 Selected markers not usable for "Selected Resources" search
1. Select a marker 2. Open Search dialog 3. Do a search with "Selected Resources" as scope The scope should consist of the resources at which the markers are attached
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchScopeFactory.java
while (iter.hasNext()) {
				Object selectedElement= iter.next();
				if (selectedElement instanceof IJavaElement)
					addJavaElements(javaElements, (IJavaElement)selectedElement);
				else if (selectedElement instanceof IResource)
					addJavaElements(javaElements, (IResource)selectedElement);
				else if (selectedElement instanceof IAdaptable) {
					IResource resource= (IResource)((IAdaptable)selectedElement).getAdapter(IResource.class);
					if (resource != null)
						addJavaElements(javaElements, resource);
				}
			}
			return SearchEngine.createJavaSearchScope((IJavaElement[])javaElements.toArray(new IJavaElement[javaElements.size()]));
		}
		return EMPTY_SCOPE;
	}
	private void addJavaElements(Set javaElements, IResource[] resources) {
		for (int i= 0; i < resources.length; i++)
			addJavaElements(javaElements, resources[i]);
	}
	private void addJavaElements(Set javaElements, IResource resource) {
		IJavaElement javaElement= JavaCore.create(resource);
		if (javaElement == null)
			
			return;
		
		if (javaElement.getElementType() == IJavaElement.PACKAGE_FRAGMENT) {
			
			try {
				addJavaElements(javaElements, ((IFolder)resource).members());