Search in sources :

Example 6 with SearchableConfigurable

use of com.intellij.openapi.options.SearchableConfigurable in project intellij-community by JetBrains.

the class GeneralSettingsConfigurable method createComponent.

@Override
public JComponent createComponent() {
    if (myComponent == null) {
        myComponent = new MyComponent();
    }
    myComponent.myChkAutoSaveIfInactive.addChangeListener(e -> myComponent.myTfInactiveTimeout.setEditable(myComponent.myChkAutoSaveIfInactive.isSelected()));
    List<SearchableConfigurable> list = getConfigurables();
    if (!list.isEmpty()) {
        myComponent.myPluginOptionsPanel.setLayout(new GridLayout(list.size(), 1));
        for (Configurable c : list) {
            myComponent.myPluginOptionsPanel.add(c.createComponent());
        }
    }
    return myComponent.myPanel;
}
Also used : SearchableConfigurable(com.intellij.openapi.options.SearchableConfigurable) CompositeConfigurable(com.intellij.openapi.options.CompositeConfigurable) Configurable(com.intellij.openapi.options.Configurable) SearchableConfigurable(com.intellij.openapi.options.SearchableConfigurable)

Example 7 with SearchableConfigurable

use of com.intellij.openapi.options.SearchableConfigurable in project intellij-community by JetBrains.

the class SearchUtil method processConfigurables.

private static void processConfigurables(Configurable[] configurables, Map<SearchableConfigurable, Set<OptionDescription>> options) {
    for (Configurable configurable : configurables) {
        if (configurable instanceof SearchableConfigurable) {
            //ignore invisible root nodes
            if (configurable instanceof SearchableConfigurable.Parent && !((SearchableConfigurable.Parent) configurable).isVisible()) {
                continue;
            }
            Set<OptionDescription> configurableOptions = new TreeSet<>();
            options.put((SearchableConfigurable) configurable, configurableOptions);
            if (configurable instanceof MasterDetails) {
                final MasterDetails md = (MasterDetails) configurable;
                md.initUi();
                processComponent(configurable, configurableOptions, md.getMaster());
                processComponent(configurable, configurableOptions, md.getDetails().getComponent());
            } else {
                processComponent(configurable, configurableOptions, configurable.createComponent());
            }
        }
    }
}
Also used : MasterDetails(com.intellij.openapi.options.MasterDetails) SearchableConfigurable(com.intellij.openapi.options.SearchableConfigurable) Configurable(com.intellij.openapi.options.Configurable) SearchableConfigurable(com.intellij.openapi.options.SearchableConfigurable)

Aggregations

SearchableConfigurable (com.intellij.openapi.options.SearchableConfigurable)7 Configurable (com.intellij.openapi.options.Configurable)5 PluginManagerConfigurable (com.intellij.ide.plugins.PluginManagerConfigurable)2 Settings (com.intellij.openapi.options.ex.Settings)2 OptionsContainingConfigurable (com.intellij.application.options.OptionsContainingConfigurable)1 ColorAndFontOptions (com.intellij.application.options.colors.ColorAndFontOptions)1 AllFileTemplatesConfigurable (com.intellij.ide.fileTemplates.impl.AllFileTemplatesConfigurable)1 DataContext (com.intellij.openapi.actionSystem.DataContext)1 KeymapPanel (com.intellij.openapi.keymap.impl.ui.KeymapPanel)1 CompositeConfigurable (com.intellij.openapi.options.CompositeConfigurable)1 ConfigurableGroup (com.intellij.openapi.options.ConfigurableGroup)1 MasterDetails (com.intellij.openapi.options.MasterDetails)1 UnnamedConfigurable (com.intellij.openapi.options.UnnamedConfigurable)1 ConfigurableWrapper (com.intellij.openapi.options.ex.ConfigurableWrapper)1 SettingsDialog (com.intellij.openapi.options.newEditor.SettingsDialog)1 ActionCallback (com.intellij.openapi.util.ActionCallback)1 THashSet (gnu.trove.THashSet)1 File (java.io.File)1 Document (org.jdom.Document)1 Element (org.jdom.Element)1