Bug 5232 Java Search page not initialized correctly from Navigator
1. Open the Navigator 2. Select a .java file (that's on the classpath) 3. Open the Search dialog (Ctrl+H) 4. Press Search ==> Nothing found. It should give the same result(s) as if the .java file would be selected in the Packages view.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
if (elements.length == 1)
							fJavaElement= elements[0];
						else
							fJavaElement= chooseFromList(elements);
						if (fJavaElement != null)
							return determineInitValuesFrom(fJavaElement);
					}
				}
			}
		}
		return null;
	}
	
	private ICodeAssist getCodeAssist(IEditorPart editorPart) {
		IEditorInput input= editorPart.getEditorInput();
		if (input instanceof ClassFileEditorInput)
			return ((ClassFileEditorInput)input).getClassFile();
		IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager();				
		return manager.getWorkingCopy(input);
	}
	private SearchPatternData trySelection(ISelection selection) {
		SearchPatternData result= null;
		if (selection == null)
			return result;
		Object o= null;
		if (selection instanceof IStructuredSelection)
			o= ((IStructuredSelection)selection).getFirstElement();
		if (o instanceof IJavaElement) {
			fJavaElement= (IJavaElement)o;
			result= determineInitValuesFrom(fJavaElement);