private static @Nullable Content getSelectedContent(@NotNull Project project) {
    ToolWindow window = getToolWindow(project);
    ContentManager manager = window == null ? null : window.getContentManagerIfCreated();
    return manager == null ? null : manager.getSelectedContent();
  }
private static @Nullable Content getSelectedContent(@NotNull Project project)