use of com.intellij.application.options.SkipSelfSearchComponent in project intellij-community by JetBrains.
the class SearchUtil method processComponent.
private static void processComponent(JComponent component, Set<OptionDescription> configurableOptions, String path) {
if (component instanceof SkipSelfSearchComponent)
return;
final Border border = component.getBorder();
if (border instanceof TitledBorder) {
final TitledBorder titledBorder = (TitledBorder) border;
final String title = titledBorder.getTitle();
if (title != null) {
processUILabel(title, configurableOptions, path);
}
}
if (component instanceof JLabel) {
final String label = ((JLabel) component).getText();
if (label != null) {
processUILabel(label, configurableOptions, path);
}
} else if (component instanceof JCheckBox) {
final String checkBoxTitle = ((JCheckBox) component).getText();
if (checkBoxTitle != null) {
processUILabel(checkBoxTitle, configurableOptions, path);
}
} else if (component instanceof JRadioButton) {
final String radioButtonTitle = ((JRadioButton) component).getText();
if (radioButtonTitle != null) {
processUILabel(radioButtonTitle, configurableOptions, path);
}
} else if (component instanceof JButton) {
final String buttonTitle = ((JButton) component).getText();
if (buttonTitle != null) {
processUILabel(buttonTitle, configurableOptions, path);
}
}
if (component instanceof JTabbedPane) {
final JTabbedPane tabbedPane = (JTabbedPane) component;
final int tabCount = tabbedPane.getTabCount();
for (int i = 0; i < tabCount; i++) {
final String title = path != null ? path + '.' + tabbedPane.getTitleAt(i) : tabbedPane.getTitleAt(i);
processUILabel(title, configurableOptions, title);
final Component tabComponent = tabbedPane.getComponentAt(i);
if (tabComponent instanceof JComponent) {
processComponent((JComponent) tabComponent, configurableOptions, title);
}
}
} else if (component instanceof TabbedPaneWrapper.TabbedPaneHolder) {
final TabbedPaneWrapper tabbedPane = ((TabbedPaneWrapper.TabbedPaneHolder) component).getTabbedPaneWrapper();
final int tabCount = tabbedPane.getTabCount();
for (int i = 0; i < tabCount; i++) {
String tabTitle = tabbedPane.getTitleAt(i);
final String title = path != null ? path + '.' + tabTitle : tabTitle;
processUILabel(title, configurableOptions, title);
final JComponent tabComponent = tabbedPane.getComponentAt(i);
if (tabComponent != null) {
processComponent(tabComponent, configurableOptions, title);
}
}
} else {
final Component[] components = component.getComponents();
if (components != null) {
for (Component child : components) {
if (child instanceof JComponent) {
processComponent((JComponent) child, configurableOptions, path);
}
}
}
}
}
Aggregations