@Override
  public void update(@NotNull AnActionEvent e) {
    super.update(e);
    Editor editor = e.getData(CommonDataKeys.EDITOR);
    e.getPresentation().setEnabledAndVisible(editor == null || !editor.getSelectionModel().hasSelection());
  }
@Override
  public void update(@NotNull AnActionEvent e)