private static @Nullable ToolWindow getToolWindow(@NotNull AnActionEvent e) {
    ToolWindow toolWindow = e.getData(PlatformDataKeys.TOOL_WINDOW);
    return toolWindow != null ? toolWindow : ArrayUtil.getFirstElement(e.getData(PlatformDataKeys.LAST_ACTIVE_TOOL_WINDOWS));
  }
private static @Nullable ToolWindow getToolWindow(@NotNull AnActionEvent e)