void (@NotNull AnActionEvent event) { final Project project = event.getProject(); if (project == null) { return; } final PsiDocumentManager psiDocumentManager = PsiDocumentManager.getInstance(project); psiDocumentManager.commitAllDocuments(); final DataContext dataContext = event.getDataContext(); final Editor editor = CommonDataKeys.EDITOR.getData(dataContext); if (null != editor) { final PsiFile psiFile = PsiUtilBase.getPsiFileInEditor(editor, project); if (null != psiFile) { final PsiClass targetClass = getTargetClass(editor, psiFile); if (null != targetClass) { process(project, psiFile, targetClass); } } } else { final VirtualFile[] files = CommonDataKeys.VIRTUAL_FILE_ARRAY.getData(dataContext); if (null != files) { for (VirtualFile file : files) { if (file.isDirectory()) { processDirectory(project, file); } else { processFile(project, file); } } } } }