RefactoringActionHandler (@NotNull DataContext dataContext) { return new RefactoringActionHandler() { @Override public void invoke(@NotNull Project project, Editor editor, PsiFile file, DataContext dataContext) { createPackageFromModule((PyFile)file); } @Override public void invoke(@NotNull Project project, PsiElement @NotNull [] elements, DataContext dataContext) { createPackageFromModule(((PyFile)elements[0])); } }; }