void (@NotNull ContentManager contentManager, @NotNull Content content) { if (content instanceof TabbedContent tabbedContent) { if (tabbedContent.hasMultipleTabs()) { JComponent component = tabbedContent.getComponent(); tabbedContent.removeContent(component); contentManager.setSelectedContent(tabbedContent, true, true); return; } } contentManager.removeContent(content, true); }