public static @Nullable ToolWindow getToolWindow(@NotNull AnActionEvent e) {
    ToolWindowManager manager = getToolWindowManager(e);
    if (manager == null) {
      return null;
    }

    ToolWindow window = e.getData(PlatformDataKeys.TOOL_WINDOW);
    if (window != null) {
      return window;
    }

    Component component = e.getData(PlatformCoreDataKeys.CONTEXT_COMPONENT);
    if (component instanceof SquareStripeButton) {
      return ((SquareStripeButton)component).getToolWindow();
    }
    if (component instanceof ToolWindowDragHelper.ToolWindowProvider twp) {
      return twp.getToolWindow();
    }
    String id = manager.getActiveToolWindowId();
    return id == null ? null : manager.getToolWindow(id);
  }
public static @Nullable ToolWindow getToolWindow(@NotNull AnActionEvent e)