private void registerToolWindow(@NotNull final ToolWindowManager toolWindowManager) {
   try {
     Method method =
         toolWindowManager
             .getClass()
             .getDeclaredMethod(
                 "registerToolWindow",
                 String.class,
                 JComponent.class,
                 ToolWindowAnchor.class,
                 boolean.class,
                 boolean.class,
                 boolean.class);
     method.setAccessible(true);
     method.invoke(
         toolWindowManager,
         StudyToolWindowFactory.STUDY_TOOL_WINDOW,
         null,
         ToolWindowAnchor.LEFT,
         true,
         true,
         true);
   } catch (Exception e) {
     final ToolWindow toolWindow =
         toolWindowManager.getToolWindow(StudyToolWindowFactory.STUDY_TOOL_WINDOW);
     if (toolWindow == null) {
       toolWindowManager.registerToolWindow(
           StudyToolWindowFactory.STUDY_TOOL_WINDOW,
           true,
           ToolWindowAnchor.RIGHT,
           myProject,
           true);
     }
   }
 }
 public void ensureVisible(Project project) {
   if (project == null) {
     return;
   }
   ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
   if (toolWindowManager != null) {
     ToolWindow toolWindow = toolWindowManager.getToolWindow(COMMIT_LOGS_TOOLWINDOW_ID);
     if (toolWindow != null) {
       toolWindow.activate(null);
     }
   }
 }