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
} catch (CoreException ex) {
				
			}
		}
			
		addJavaElements(javaElements, javaElement);
	}
	private void addJavaElements(Set javaElements, IJavaElement javaElement) {
		switch (javaElement.getElementType()) {
			case IJavaElement.JAVA_PROJECT:
				addJavaElements(javaElements, (IJavaProject)javaElement);
				break;
			default:
				javaElements.add(javaElement);
		}
		
	}
	private void addJavaElements(Set javaElements, IJavaProject javaProject) {
		IPackageFragmentRoot[] roots;
		try {
			roots= javaProject.getPackageFragmentRoots();
		} catch (JavaModelException ex) {
			return;
		}
		for (int i= 0; i < roots.length; i++)
			if (!roots[i].isExternal())
				javaElements.add(roots[i]);
	}
}