VirtualFile (final CompileContext context, final VirtualFile formFile, final String className) { final Module module = context.getModuleByFile(formFile); if (module == null) { return null; } final PsiClass aClass = FormEditingUtil.findClassToBind(module, className); if (aClass == null) { return null; } final PsiFile containingFile = aClass.getContainingFile(); if (containingFile == null){ return null; } return containingFile.getVirtualFile(); }