Bug 16287 Feature request: "Search in project" option
Hi, I guess a "search in selected project" option in the search dialog would be a good feature. It could also be added to the "References", "Declarations" and "Implementators" popup menu.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchScopeFactory.java
public IJavaSearchScope createJavaSearchScope(ISelection selection) {
		if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
			Iterator iter= ((IStructuredSelection)selection).iterator();
			Set javaElements= new HashSet(((IStructuredSelection)selection).size());
			while (iter.hasNext()) {
				Object selectedElement= iter.next();
				
				if (selectedElement instanceof ISearchResultViewEntry)
					selectedElement= ((ISearchResultViewEntry)selectedElement).getGroupByKey();
				if (selectedElement instanceof IJavaElement)
					addJavaElements(javaElements, (IJavaElement)selectedElement);
				else if (selectedElement instanceof IResource)
					addJavaElements(javaElements, (IResource)selectedElement);
				else if (selectedElement instanceof LogicalPackage)
					addJavaElements(javaElements, (LogicalPackage)selectedElement);
				else if (selectedElement instanceof IAdaptable) {
					IResource resource= (IResource)((IAdaptable)selectedElement).getAdapter(IResource.class);
					if (resource != null)
						addJavaElements(javaElements, resource);
				}
			}
			return createJavaSearchScope(javaElements);
		}
		return EMPTY_SCOPE;
	}
	private IJavaSearchScope createJavaSearchScope(Set javaElements) {
		return SearchEngine.createJavaSearchScope((IJavaElement[])javaElements.toArray(new IJavaElement[javaElements.size()]));
	}
	private void addJavaElements(Set javaElements, IResource[] resources) {