public final void execute(@NotNull Editor editor, @Nullable Caret contextCaret, @Nullable DataContext dataContext) {
    if (LOG.isDebugEnabled()) {
      // The line will be logged multiple times for the same action. The last event in the chain is, typically, the 'actual event handler'.
      LOG.debug("Invoked handler " + this + " in " + editor + " for the caret " + contextCaret,
                LOG.isTraceEnabled() ? new Throwable() : null);
    }

    Editor hostEditor = dataContext == null ? null : CommonDataKeys.HOST_EDITOR.getData(dataContext);
    if (hostEditor == null) {
      hostEditor = editor;
    }
    if (contextCaret == null && runForAllCarets()) {
      hostEditor.getCaretModel().runForEachCaret(caret -> {
        DataContext refreshed = commitAndRefreshDataContextIfNeeded(dataContext, caret);
        doIfEnabled(caret, refreshed,
                    (c, dc) -> doExecute(c.getEditor(), c, dc));
      });
    }
    else if (contextCaret == null) {
      Caret caret = hostEditor.getCaretModel().getCurrentCaret();
      DataContext refreshed = commitAndRefreshDataContextIfNeeded(dataContext, caret);
      doIfEnabled(caret, refreshed,
                  (c, dc) -> doExecute(c.getEditor(), null, dc));
    }
    else {
      doExecute(editor, contextCaret, dataContext);
    }
  }
public final void execute(@NotNull Editor editor, @Nullable Caret contextCaret, @Nullable DataContext dataContext)