boolean (SearchableConfigurable configurable, JComponent rootComponent, String option, boolean force) { rootComponent.putClientProperty(HIGHLIGHT_WITH_BORDER, null); if (option == null || option.trim().length() == 0) { return false; } List<String> label = getLabelsFromComponent(rootComponent); if (!label.isEmpty()) { for (String each : label) { if (isComponentHighlighted(each, option, force, configurable)) { highlightComponent(rootComponent, option); return true; // do not visit children of highlighted component } } } else if (rootComponent instanceof JComboBox) { List<String> labels = getItemsFromComboBox(((JComboBox<?>)rootComponent)); if (labels.stream().anyMatch(t -> isComponentHighlighted(t, option, force, configurable))) { highlightComponent(rootComponent, option); // do not visit children of highlighted component return true; } } else if (rootComponent instanceof JTabbedPane tabbedPane) { final Set<String> paths = SearchableOptionsRegistrar.getInstance().getInnerPaths(configurable, option); for (String path : paths) { if (path != null) { final int index = getSelection(path, tabbedPane.getTabCount(), i -> tabbedPane.getTitleAt(i)); if (index > -1 && index < tabbedPane.getTabCount()) { if (tabbedPane.getTabComponentAt(index) instanceof JComponent) { highlightComponent((JComponent)tabbedPane.getTabComponentAt(index), option); } } } } } else if (rootComponent instanceof TabbedPaneWrapper.TabbedPaneHolder) { final TabbedPaneWrapper tabbedPaneWrapper = ((TabbedPaneWrapper.TabbedPaneHolder)rootComponent).getTabbedPaneWrapper(); final Set<String> paths = SearchableOptionsRegistrar.getInstance().getInnerPaths(configurable, option); for (String path : paths) { if (path != null) { final int index = getSelection(path, tabbedPaneWrapper.getTabCount(), i -> tabbedPaneWrapper.getTitleAt(i)); if (index > -1 && index < tabbedPaneWrapper.getTabCount()) { highlightComponent((JComponent)tabbedPaneWrapper.getTabComponentAt(index), option); } } } } Border border = rootComponent.getBorder(); if (border instanceof TitledBorder) { String title = ((TitledBorder)border).getTitle(); if (isComponentHighlighted(title, option, force, configurable)) { highlightComponent(rootComponent, option); rootComponent.putClientProperty(HIGHLIGHT_WITH_BORDER, Boolean.TRUE); return true; // do not visit children of highlighted component } } boolean highlight = false; for (Component component : rootComponent.getComponents()) { if (component instanceof JComponent && traverseComponentsTree(configurable, (JComponent)component, option, force)) { highlight = true; } } return highlight; }