Search in sources :

Example 11 with Configurable

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

the class ModuleEditor method createEditors.

private void createEditors(@Nullable Module module) {
    if (module == null)
        return;
    ModuleConfigurationState state = createModuleConfigurationState();
    for (ModuleConfigurationEditorProvider provider : collectProviders(module)) {
        ModuleConfigurationEditor[] editors = provider.createEditors(state);
        if (editors.length > 0 && provider instanceof ModuleConfigurationEditorProviderEx && ((ModuleConfigurationEditorProviderEx) provider).isCompleteEditorSet()) {
            myEditors.clear();
            ContainerUtil.addAll(myEditors, editors);
            break;
        } else {
            ContainerUtil.addAll(myEditors, editors);
        }
    }
    for (Configurable moduleConfigurable : ServiceKt.getComponents(module, Configurable.class)) {
        reportDeprecatedModuleEditor(moduleConfigurable.getClass());
        myEditors.add(new ModuleConfigurableWrapper(moduleConfigurable));
    }
    for (ModuleConfigurableEP extension : module.getExtensions(MODULE_CONFIGURABLES)) {
        if (extension.canCreateConfigurable()) {
            Configurable configurable = extension.createConfigurable();
            if (configurable != null) {
                reportDeprecatedModuleEditor(configurable.getClass());
                myEditors.add(new ModuleConfigurableWrapper(configurable));
            }
        }
    }
}
Also used : ModuleConfigurationEditor(com.intellij.openapi.module.ModuleConfigurationEditor) Configurable(com.intellij.openapi.options.Configurable) ModuleConfigurableEP(com.intellij.openapi.options.ModuleConfigurableEP)

Example 12 with Configurable

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

the class ProjectStructureConfigurable method initSidePanel.

private void initSidePanel() {
    boolean isDefaultProject = myProject == ProjectManager.getInstance().getDefaultProject();
    mySidePanel = new SidePanel(this);
    mySidePanel.addSeparator("Project Settings");
    addProjectConfig();
    if (!isDefaultProject) {
        addModulesConfig();
    }
    addProjectLibrariesConfig();
    if (!isDefaultProject) {
        addFacetsConfig();
        addArtifactsConfig();
    }
    ProjectStructureConfigurableContributor[] adders = ProjectStructureConfigurableContributor.EP_NAME.getExtensions();
    for (ProjectStructureConfigurableContributor adder : adders) {
        for (Configurable configurable : adder.getExtraProjectConfigurables(myProject, myContext)) {
            addConfigurable(configurable, true);
        }
    }
    mySidePanel.addSeparator("Platform Settings");
    addJdkListConfig();
    addGlobalLibrariesConfig();
    for (ProjectStructureConfigurableContributor adder : adders) {
        for (Configurable configurable : adder.getExtraPlatformConfigurables(myProject, myContext)) {
            addConfigurable(configurable, true);
        }
    }
    mySidePanel.addSeparator("--");
    addErrorPane();
}
Also used : Configurable(com.intellij.openapi.options.Configurable) BaseConfigurable(com.intellij.openapi.options.BaseConfigurable) ArtifactsStructureConfigurable(com.intellij.openapi.roots.ui.configuration.artifacts.ArtifactsStructureConfigurable) SearchableConfigurable(com.intellij.openapi.options.SearchableConfigurable)

Example 13 with Configurable

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

the class SearchableOptionsTest method testFindCodeTemplates.

public void testFindCodeTemplates() {
    ConfigurableGroup[] groups = ShowSettingsUtilImpl.getConfigurableGroups(getProject(), false);
    ConfigurableHit configurables = SearchableOptionsRegistrar.getInstance().getConfigurables(groups, DocumentEvent.EventType.INSERT, null, "method", getProject());
    Set<Configurable> configurableSet = configurables.getAll();
    for (Configurable configurable : configurableSet) {
        if (configurable.getDisplayName().equals(new AllFileTemplatesConfigurable(getProject()).getDisplayName())) {
            return;
        }
    }
    fail("File Templates are not found");
}
Also used : ConfigurableHit(com.intellij.ide.ui.search.ConfigurableHit) ConfigurableGroup(com.intellij.openapi.options.ConfigurableGroup) AllFileTemplatesConfigurable(com.intellij.ide.fileTemplates.impl.AllFileTemplatesConfigurable) AllFileTemplatesConfigurable(com.intellij.ide.fileTemplates.impl.AllFileTemplatesConfigurable) Configurable(com.intellij.openapi.options.Configurable)

Example 14 with Configurable

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

the class SearchUtil method expandGroup.

public static List<Configurable> expandGroup(final ConfigurableGroup group) {
    final Configurable[] configurables = group.getConfigurables();
    List<Configurable> result = new ArrayList<>();
    ContainerUtil.addAll(result, configurables);
    for (Configurable each : configurables) {
        addChildren(each, result);
    }
    return ContainerUtil.filter(result, configurable -> !(configurable instanceof SearchableConfigurable.Parent) || ((SearchableConfigurable.Parent) configurable).isVisible());
}
Also used : Configurable(com.intellij.openapi.options.Configurable) SearchableConfigurable(com.intellij.openapi.options.SearchableConfigurable)

Example 15 with Configurable

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

the class SearchUtil method addChildren.

private static void addChildren(Configurable configurable, List<Configurable> list) {
    if (configurable instanceof Configurable.Composite) {
        final Configurable[] kids = ((Configurable.Composite) configurable).getConfigurables();
        for (Configurable eachKid : kids) {
            list.add(eachKid);
            addChildren(eachKid, list);
        }
    }
}
Also used : Configurable(com.intellij.openapi.options.Configurable) SearchableConfigurable(com.intellij.openapi.options.SearchableConfigurable)

Aggregations

Configurable (com.intellij.openapi.options.Configurable)66 SearchableConfigurable (com.intellij.openapi.options.SearchableConfigurable)32 BaseConfigurable (com.intellij.openapi.options.BaseConfigurable)8 NotNull (org.jetbrains.annotations.NotNull)8 ConfigurableGroup (com.intellij.openapi.options.ConfigurableGroup)7 UnnamedConfigurable (com.intellij.openapi.options.UnnamedConfigurable)7 Nullable (org.jetbrains.annotations.Nullable)6 Project (com.intellij.openapi.project.Project)5 ArrayList (java.util.ArrayList)5 ConfigurationException (com.intellij.openapi.options.ConfigurationException)4 ArtifactsStructureConfigurable (com.intellij.openapi.roots.ui.configuration.artifacts.ArtifactsStructureConfigurable)4 ApplicationConfigurable (com.intellij.execution.application.ApplicationConfigurable)3 JUnitConfigurable (com.intellij.execution.junit2.configuration.JUnitConfigurable)3 DataContext (com.intellij.openapi.actionSystem.DataContext)3 Module (com.intellij.openapi.module.Module)3 TabbedConfigurable (com.intellij.openapi.options.TabbedConfigurable)3 Settings (com.intellij.openapi.options.ex.Settings)3 ActionCallback (com.intellij.openapi.util.ActionCallback)3 ExtensionsArea (com.intellij.openapi.extensions.ExtensionsArea)2 CompositeConfigurable (com.intellij.openapi.options.CompositeConfigurable)2