Search in sources :

Example 6 with Configurable

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

the class DebuggerConfigurable method computeMergedConfigurables.

private static void computeMergedConfigurables(@NotNull DebuggerConfigurableProvider[] providers, @NotNull List<Configurable> result) {
    for (DebuggerSettingsCategory category : MERGED_CATEGORIES) {
        List<Configurable> configurables = getConfigurables(category, providers);
        if (!configurables.isEmpty()) {
            String id = category.name().toLowerCase(Locale.ENGLISH);
            result.add(new MergedCompositeConfigurable("debugger." + id, XDebuggerBundle.message("debugger." + id + ".display.name"), configurables.toArray(new Configurable[configurables.size()])));
        }
    }
}
Also used : DebuggerSettingsCategory(com.intellij.xdebugger.settings.DebuggerSettingsCategory) Configurable(com.intellij.openapi.options.Configurable) SearchableConfigurable(com.intellij.openapi.options.SearchableConfigurable)

Example 7 with Configurable

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

the class MergedCompositeConfigurable method createComponent.

@Nullable
@Override
public JComponent createComponent() {
    if (rootComponent == null) {
        Configurable firstConfigurable = children[0];
        if (children.length == 1) {
            rootComponent = firstConfigurable.createComponent();
            String rootComponentDisplayName = firstConfigurable.getDisplayName();
            if (!StringUtil.isEmpty(rootComponentDisplayName) && !isTargetedToProduct(firstConfigurable)) {
                rootComponent.setBorder(IdeBorderFactory.createTitledBorder(rootComponentDisplayName, false, FIRST_COMPONENT_INSETS));
            }
        } else {
            boolean isFirstNamed = true;
            JPanel panel = createPanel(true);
            for (Configurable configurable : children) {
                JComponent component = configurable.createComponent();
                assert component != null;
                String displayName = configurable.getDisplayName();
                if (StringUtil.isEmpty(displayName)) {
                    component.setBorder(BOTTOM_INSETS);
                } else {
                    boolean addBorder = true;
                    if (isUseTargetedProductPolicyIfSeveralChildren() && isFirstNamed) {
                        isFirstNamed = false;
                        if (isTargetedToProduct(configurable)) {
                            addBorder = false;
                        }
                    }
                    if (addBorder) {
                        component.setBorder(IdeBorderFactory.createTitledBorder(displayName, false, firstConfigurable == configurable ? FIRST_COMPONENT_INSETS : N_COMPONENT_INSETS));
                    }
                }
                panel.add(component);
            }
            rootComponent = panel;
        }
    }
    return rootComponent;
}
Also used : Configurable(com.intellij.openapi.options.Configurable) SearchableConfigurable(com.intellij.openapi.options.SearchableConfigurable) Nullable(org.jetbrains.annotations.Nullable)

Example 8 with Configurable

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

the class InjectionsSettingsUI method buildConfigurables.

@Override
protected Configurable[] buildConfigurables() {
    final ArrayList<Configurable> configurables = new ArrayList<>();
    for (LanguageInjectionSupport support : InjectorUtils.getActiveInjectionSupports()) {
        ContainerUtil.addAll(configurables, support.createSettings(myProject, myConfiguration));
    }
    Collections.sort(configurables, (o1, o2) -> Comparing.compare(o1.getDisplayName(), o2.getDisplayName()));
    return configurables.toArray(new Configurable[configurables.size()]);
}
Also used : AbstractLanguageInjectionSupport(org.intellij.plugins.intelliLang.inject.AbstractLanguageInjectionSupport) LanguageInjectionSupport(org.intellij.plugins.intelliLang.inject.LanguageInjectionSupport) Configurable(com.intellij.openapi.options.Configurable) SearchableConfigurable(com.intellij.openapi.options.SearchableConfigurable)

Example 9 with Configurable

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

the class SubCompositeConfigurable method disposeUIResources.

@Override
public final void disposeUIResources() {
    root = null;
    rootComponent = null;
    if (isChildrenMerged()) {
        for (Configurable child : children) {
            child.disposeUIResources();
        }
    }
    children = null;
}
Also used : Configurable(com.intellij.openapi.options.Configurable) SearchableConfigurable(com.intellij.openapi.options.SearchableConfigurable)

Example 10 with Configurable

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

the class FacetTypeEditor method createComponent.

@Override
public JComponent createComponent() {
    MultipleFacetSettingsEditor allFacetsEditor = createAllFacetsEditor();
    if (myAllFacetsEditor != null) {
        myAllFacetsEditor.disposeUIResources();
    }
    myAllFacetsEditor = allFacetsEditor;
    myCurrentConfigurables = new ArrayList<>();
    if (myDefaultSettingsConfigurable != null) {
        myCurrentConfigurables.add(myDefaultSettingsConfigurable);
    }
    if (myAllFacetsEditor != null) {
        myCurrentConfigurables.add(new AllFacetsConfigurable(myAllFacetsEditor));
    }
    if (myCurrentConfigurables.isEmpty()) {
        return new JPanel();
    }
    if (myCurrentConfigurables.size() == 1) {
        return myCurrentConfigurables.get(0).createComponent();
    }
    myTabbedPane = new TabbedPaneWrapper(myDisposable);
    for (Configurable configurable : myCurrentConfigurables) {
        myTabbedPane.addTab(configurable.getDisplayName(), configurable.createComponent());
    }
    return myTabbedPane.getComponent();
}
Also used : MultipleFacetSettingsEditor(com.intellij.facet.ui.MultipleFacetSettingsEditor) TabbedPaneWrapper(com.intellij.ui.TabbedPaneWrapper) Configurable(com.intellij.openapi.options.Configurable)

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