Bug 62959 Search in enclosing project doesn't take project from editor
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.javaElementAccess.title"), SearchMessages.getString("Search.Error.javaElementAccess.message")); 
					break;
				}		
				limitTo= REFERENCES;
				pattern= PrettySignature.getMethodSignature((IMethod)element);
				break;
		}
		if (searchFor != UNKNOWN && limitTo != UNKNOWN && pattern != null)
			return new SearchPatternData(searchFor, limitTo, true, pattern, element);
			
		return null;	
	}
	
	private SearchPatternData trySimpleTextSelection(ISelection selection) {
		SearchPatternData result= null;
		if (selection instanceof ITextSelection) {
			String selectedText= ((ITextSelection) selection).getText();
			if (selectedText != null) {
				BufferedReader reader= new BufferedReader(new StringReader(selectedText));
				String text;
				try {
					text= reader.readLine();
					if (text == null)
						text= ""; 
				} catch (IOException ex) {
					text= ""; 
				}
				result= new SearchPatternData(TYPE, REFERENCES, fIsCaseSensitive, text, null);
			}
		}