@Override
  public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
    if (!AcceptedLanguageLevelsSettings.isLanguageLevelAccepted(myLevel)) {
      JComponent component = editor == null ? null : editor.getComponent();
      if (AcceptedLanguageLevelsSettings.checkAccepted(component, myLevel) == null) {
        return;
      }
    }
    Module module = Objects.requireNonNull(ModuleUtilCore.findModuleForFile(file));
    LanguageLevel oldLevel = LanguageLevelUtil.getCustomLanguageLevel(module);
    VirtualFile vFile = file.getVirtualFile();
    WriteCommandAction.runWriteCommandAction(project, getText(), null, () -> {
      JavaProjectModelModificationService.getInstance(project).changeLanguageLevel(module, myLevel, true);
      if (oldLevel != null) {
        UndoManager.getInstance(project).undoableActionPerformed(new BasicUndoableAction(vFile) {
          @Override
          public void undo() {
            JavaProjectModelModificationService.getInstance(project).changeLanguageLevel(module, oldLevel, true);
          }

          @Override
          public void redo() {
            JavaProjectModelModificationService.getInstance(project).changeLanguageLevel(module, myLevel, true);
          }
        });
      }
    });
  }
@Override
  public void invoke(@NotNull Project project, Editor editor, PsiFile file)