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 (searchFor != UNKNOWN && limitTo != UNKNOWN && pattern != null)
			return new SearchPatternData(searchFor, limitTo, pattern, element);
			
		return null;	
	}
	
	private SearchPatternData trySimpleTextSelection(ISelection selection) {
		SearchPatternData result= null;
		if (selection instanceof ITextSelection) {
			BufferedReader reader= new BufferedReader(new StringReader(((ITextSelection)selection).getText()));
			String text;
			try {
				text= reader.readLine();
				if (text == null)
					text= ""; 
			} catch (IOException ex) {
				text= ""; 
			}
			result= new SearchPatternData(TYPE, REFERENCES, text, null);
		}
		return result;
	}
	
	private SearchPatternData getDefaultInitValues() {
		return new SearchPatternData(TYPE, REFERENCES, "", null); 
	}	
	private IJavaElement chooseFromList(IJavaElement[] openChoices) {
		ILabelProvider labelProvider= new JavaElementLabelProvider(
			  JavaElementLabelProvider.SHOW_DEFAULT