pattern= JavaModelUtil.getFullyQualifiedName((IType) mainType);
pattern= JavaModelUtil.getFullyQualifiedName(mainType);
	private SearchPatternData determineInitValuesFrom(IJavaElement element) {		if (element == null)			return null;		int searchFor= UNKNOWN;		String pattern= null;		switch (element.getElementType()) {			case IJavaElement.PACKAGE_FRAGMENT :				searchFor= PACKAGE;				pattern= element.getElementName();				break;			case IJavaElement.PACKAGE_FRAGMENT_ROOT :				searchFor= PACKAGE;				pattern= element.getElementName();				break;			case IJavaElement.PACKAGE_DECLARATION :				searchFor= PACKAGE;				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;				}				break;			case IJavaElement.TYPE :				searchFor= TYPE;				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, NLSSearchMessages.getString("Search.Error.javaElementAccess.title"), NLSSearchMessages.getString("Search.Error.javaElementAccess.message")); //$NON-NLS-2$ //$NON-NLS-1$					break;				}				searchFor= TYPE;				element= mainType;				pattern= JavaModelUtil.getFullyQualifiedName((IType) mainType);				break;			case IJavaElement.CLASS_FILE :				IClassFile cf= (IClassFile) element;				try {					mainType= cf.getType();				} catch (JavaModelException ex) {					ExceptionHandler.handle(ex, NLSSearchMessages.getString("Search.Error.javaElementAccess.title"), NLSSearchMessages.getString("Search.Error.javaElementAccess.message")); //$NON-NLS-2$ //$NON-NLS-1$					break;				}				if (mainType == null)					break;				searchFor= TYPE;				pattern= JavaModelUtil.getFullyQualifiedName(mainType);				break;			case IJavaElement.FIELD :				searchFor= FIELD;				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, NLSSearchMessages.getString("Search.Error.javaElementAccess.title"), NLSSearchMessages.getString("Search.Error.javaElementAccess.message")); //$NON-NLS-2$ //$NON-NLS-1$					break;				}				pattern= PrettySignature.getMethodSignature((IMethod) element);				break;		}		if (searchFor == TYPE && pattern != null) {			String propertyFilePathStr= ""; //$NON-NLS-1$			// make suggestion for properties file			IPath path= element.getPath().removeFileExtension().addFileExtension("properties"); //$NON-NLS-1$			propertyFilePathStr= path.toString();			return new SearchPatternData(pattern, element, propertyFilePathStr); //$NON-NLS-1$		}		return null;	}