void (@NotNull IdeFrameImpl frame, @Nullable IdeFrameImpl tab) { JPanel parentComponent = getTabsContainer(frame); WindowTabsComponent tabs = getTabsComponent(parentComponent); if (tabs == null) { return; // no tabs } if (tab == null || tabs.removeTabFromFrame(tab)) { parentComponent.remove(tabs); parentComponent.setVisible(false); tabs.selfDispose(); Container parent = parentComponent.getParent(); if (parent != null) { parent.doLayout(); parent.revalidate(); parent.repaint(); } } }