private static @Nullable Content getContextContent(@NotNull AnActionEvent e, @NotNull ToolWindow toolWindow) {
    BaseLabel baseLabel = ObjectUtils.tryCast(e.getData(PlatformCoreDataKeys.CONTEXT_COMPONENT), BaseLabel.class);
    Content selectedContent = baseLabel != null ? baseLabel.getContent() : null;
    if (selectedContent == null) {
      selectedContent = toolWindow.getContentManager().getSelectedContent();
    }
    return selectedContent;
  }
private static @Nullable Content getContextContent(@NotNull AnActionEvent e, @NotNull ToolWindow toolWindow)