@Override
  public void update(@NotNull AnActionEvent e) {
    Project project = e.getProject();
    History history = e.getData(History.KEY);
    boolean isModalContext = e.getData(PlatformCoreDataKeys.IS_MODAL_CONTEXT) == Boolean.TRUE;

    Presentation presentation = e.getPresentation();
    if (history != null) {
      presentation.setEnabled(history.canGoForward());
    }
    else if (project != null && !project.isDisposed()) {
      presentation.setEnabled(!isModalContext && IdeDocumentHistory.getInstance(project).isForwardAvailable());
    }
    else {
      presentation.setEnabled(false);
    }
  }
@Override
  public void update(@NotNull AnActionEvent e)