return new SearchPatternData(searchFor, limitTo, pattern, element);
return new SearchPatternData(searchFor, limitTo, true, pattern, element);
	private SearchPatternData determineInitValuesFrom(IJavaElement element) {		if (element == null)			return null;		int searchFor= UNKNOWN;		int limitTo= UNKNOWN;		String pattern= null; 		switch (element.getElementType()) {			case IJavaElement.PACKAGE_FRAGMENT:				searchFor= PACKAGE;				limitTo= REFERENCES;				pattern= element.getElementName();				break;			case IJavaElement.PACKAGE_FRAGMENT_ROOT:				searchFor= PACKAGE;				limitTo= REFERENCES;				pattern= element.getElementName();				break;			case IJavaElement.PACKAGE_DECLARATION:				searchFor= PACKAGE;				limitTo= REFERENCES;				pattern= element.getElementName();				break;			case IJavaElement.IMPORT_DECLARATION:				pattern= element.getElementName();				IImportDeclaration declaration= (IImportDeclaration)element;				if (declaration.isOnDemand()) {					searchFor= PACKAGE;					int index= pattern.lastIndexOf('.');					pattern= pattern.substring(0, index);				} else {					searchFor= TYPE;				}				limitTo= DECLARATIONS;				break;			case IJavaElement.TYPE:				searchFor= TYPE;				limitTo= REFERENCES;				pattern= JavaModelUtil.getFullyQualifiedName((IType)element);				break;			case IJavaElement.COMPILATION_UNIT:				ICompilationUnit cu= (ICompilationUnit)element;				String mainTypeName= element.getElementName().substring(0, element.getElementName().indexOf(".")); //$NON-NLS-1$				IType mainType= cu.getType(mainTypeName);				mainTypeName= JavaModelUtil.getTypeQualifiedName(mainType);				try {										mainType= JavaModelUtil.findTypeInCompilationUnit(cu, mainTypeName);					if (mainType == null) {						// fetch type which is declared first in the file						IType[] types= cu.getTypes();						if (types.length > 0)							mainType= types[0];						else							break;					}				} catch (JavaModelException ex) {					ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.javaElementAccess.title"), SearchMessages.getString("Search.Error.javaElementAccess.message")); //$NON-NLS-2$ //$NON-NLS-1$					break;				}				searchFor= TYPE;				element= mainType;				limitTo= REFERENCES;				pattern= JavaModelUtil.getFullyQualifiedName((IType)mainType);				break;			case IJavaElement.CLASS_FILE:				IClassFile cf= (IClassFile)element;				try {										mainType= cf.getType();				} catch (JavaModelException ex) {					ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.javaElementAccess.title"), SearchMessages.getString("Search.Error.javaElementAccess.message")); //$NON-NLS-2$ //$NON-NLS-1$					break;				}				if (mainType == null)					break;				element= mainType;				searchFor= TYPE;				limitTo= REFERENCES;				pattern= JavaModelUtil.getFullyQualifiedName(mainType);				break;			case IJavaElement.FIELD:				searchFor= FIELD;				limitTo= REFERENCES;				IType type= ((IField)element).getDeclaringType();				StringBuffer buffer= new StringBuffer();				buffer.append(JavaModelUtil.getFullyQualifiedName(type));				buffer.append('.');				buffer.append(element.getElementName());				pattern= buffer.toString();				break;			case IJavaElement.METHOD:				searchFor= METHOD;				try {					IMethod method= (IMethod)element;					if (method.isConstructor())						searchFor= CONSTRUCTOR;				} catch (JavaModelException ex) {					ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.javaElementAccess.title"), SearchMessages.getString("Search.Error.javaElementAccess.message")); //$NON-NLS-2$ //$NON-NLS-1$					break;				}						limitTo= REFERENCES;				pattern= PrettySignature.getMethodSignature((IMethod)element);				break;		}		if (searchFor != UNKNOWN && limitTo != UNKNOWN && pattern != null)			return new SearchPatternData(searchFor, limitTo, pattern, element);					return null;		}