boolean (JComponent component) { Boolean holder = ClientProperty.get(component, ServiceViewDescriptor.ACTION_HOLDER_KEY); if (Boolean.TRUE == holder) { return false; } while (true) { if (component instanceof JBTabs || component instanceof JTabbedPane) { return false; } if (component.getComponentCount() > 1) { // JBTabs is placed next to some component. return ContainerUtil.filterIsInstance(component.getComponents(), JBTabs.class).size() != 1; } if (component.getComponentCount() != 1) { return true; } Component child = component.getComponent(0); if (child instanceof JComponent childComponent) { component = childComponent; } else { return true; } } }