Bug 6503 Search page - should offer case sensitivity check box
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
private SearchPatternData tryTypedTextSelection(ISelection selection) {
		if (selection instanceof ITextSelection) {
			IEditorPart e= getEditorPart();
			if (e != null) {
				ITextSelection ts= (ITextSelection)selection;
				ICodeAssist assist= getCodeAssist(e);
				if (assist != null) {
					IJavaElement[] elements= null;
					try {
						elements= assist.codeSelect(ts.getOffset(), ts.getLength());
					} catch (JavaModelException ex) {
						ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.createJavaElement.title"), SearchMessages.getString("Search.Error.createJavaElement.message")); 
					}
					if (elements != null && elements.length > 0) {
						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 IClassFileEditorInput)