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
}	
	
	private void initSelections() {
		fStructuredSelection= asStructuredSelection();
		fInitialData= tryStructuredSelection(fStructuredSelection);
		if (fInitialData == null)
			fInitialData= trySimpleTextSelection(getContainer().getSelection());
		if (fInitialData == null)
			fInitialData= getDefaultInitValues();
		fJavaElement= fInitialData.getJavaElement();
		fCaseSensitive.setSelection(fInitialData.isCaseSensitive());
		fCaseSensitive.setEnabled(fInitialData.getJavaElement() == null);
		fSearchFor[fInitialData.getSearchFor()].setSelection(true);
		setLimitTo(fInitialData.getSearchFor());
		fLimitTo[fInitialData.getLimitTo()].setSelection(true);		
		fPattern.setText(fInitialData.getPattern());
		updateUseJRE();
	}
	private void updateUseJRE() {
		boolean shouldEnable= mayExcludeJRE();
		if (shouldEnable) {
			fSearchJRE.setSelection(getSearchJRE());
			fSearchJRE.setEnabled(true);
		} else {
			fSearchJRE.setEnabled(false);
			fSearchJRE.setSelection(true);
		}
	}
	private boolean mayExcludeJRE() {
		return getLimitTo() == INDEX_REFERENCES || getLimitTo() == INDEX_ALL;