Search in sources :

Example 56 with Configurable

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

the class VcsManagerConfigurable method buildConfigurables.

@Override
protected Configurable[] buildConfigurables() {
    myGeneralPanel = new VcsGeneralConfigurationConfigurable(myProject, this);
    List<Configurable> result = new ArrayList<>();
    result.add(myGeneralPanel);
    result.add(new VcsBackgroundOperationsConfigurable(myProject));
    if (!myProject.isDefault()) {
        result.add(new IgnoredSettingsPanel(myProject));
    }
    /*if (!myProject.isDefault()) {
      result.add(new CacheSettingsPanel(myProject));
    }*/
    result.add(new IssueNavigationConfigurationPanel(myProject));
    if (!myProject.isDefault()) {
        result.add(new ChangelistConflictConfigurable(ChangeListManagerImpl.getInstanceImpl(myProject)));
    }
    result.add(new ShelfProjectConfigurable(myProject));
    for (VcsConfigurableProvider provider : VcsConfigurableProvider.EP_NAME.getExtensions()) {
        final Configurable configurable = provider.getConfigurable(myProject);
        if (configurable != null) {
            result.add(configurable);
        }
    }
    VcsDescriptor[] vcses = ProjectLevelVcsManager.getInstance(myProject).getAllVcss();
    for (VcsDescriptor vcs : vcses) {
        result.add(createVcsConfigurableWrapper(vcs));
    }
    return result.toArray(new Configurable[result.size()]);
}
Also used : VcsConfigurableProvider(com.intellij.openapi.vcs.VcsConfigurableProvider) ArrayList(java.util.ArrayList) Configurable(com.intellij.openapi.options.Configurable) SearchableConfigurable(com.intellij.openapi.options.SearchableConfigurable) ChangelistConflictConfigurable(com.intellij.openapi.vcs.changes.conflicts.ChangelistConflictConfigurable) IgnoredSettingsPanel(com.intellij.openapi.vcs.changes.ui.IgnoredSettingsPanel) ChangelistConflictConfigurable(com.intellij.openapi.vcs.changes.conflicts.ChangelistConflictConfigurable) VcsDescriptor(com.intellij.openapi.vcs.impl.VcsDescriptor)

Example 57 with Configurable

use of com.intellij.openapi.options.Configurable 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)

Example 58 with Configurable

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

the class MavenSettingsTest method testNotModifiedAfterCreation.

public void testNotModifiedAfterCreation() throws Exception {
    MavenSettings s = new MavenSettings(myProject);
    s.createComponent();
    s.reset();
    try {
        assertFalse(s.isModified());
    } finally {
        //prevent memory leaks
        s.disposeUIResources();
    }
    for (Configurable each : s.getConfigurables()) {
        each.createComponent();
        each.reset();
        try {
            assertFalse(each.isModified());
        } finally {
            //prevent memory leaks
            each.disposeUIResources();
        }
    }
}
Also used : Configurable(com.intellij.openapi.options.Configurable) MavenSettings(org.jetbrains.idea.maven.utils.MavenSettings)

Example 59 with Configurable

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

the class CompositeConfigurable method createComponent.

public JComponent createComponent() {
    tabbedPane = new JBTabbedPane();
    for (Configurable configurable : configurables) {
        JComponent component = configurable.createComponent();
        tabbedPane.add(configurable.getDisplayName(), component);
    }
    return tabbedPane;
}
Also used : JBTabbedPane(com.intellij.ui.components.JBTabbedPane) Configurable(com.intellij.openapi.options.Configurable)

Example 60 with Configurable

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

the class SearchEverywhereAction method fillConfigurablesIds.

private void fillConfigurablesIds(String pathToParent, Configurable[] configurables) {
    for (Configurable configurable : configurables) {
        if (configurable instanceof SearchableConfigurable) {
            final String id = ((SearchableConfigurable) configurable).getId();
            String name = configurable.getDisplayName();
            if (pathToParent != null) {
                name = pathToParent + " -> " + name;
            }
            myConfigurables.put(id, name);
            if (configurable instanceof SearchableConfigurable.Parent) {
                fillConfigurablesIds(name, ((SearchableConfigurable.Parent) configurable).getConfigurables());
            }
        }
    }
}
Also used : SearchableConfigurable(com.intellij.openapi.options.SearchableConfigurable) Configurable(com.intellij.openapi.options.Configurable) SearchableConfigurable(com.intellij.openapi.options.SearchableConfigurable)

Aggregations

Configurable (com.intellij.openapi.options.Configurable)62 SearchableConfigurable (com.intellij.openapi.options.SearchableConfigurable)31 BaseConfigurable (com.intellij.openapi.options.BaseConfigurable)8 ConfigurableGroup (com.intellij.openapi.options.ConfigurableGroup)7 NotNull (org.jetbrains.annotations.NotNull)7 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 UnnamedConfigurable (com.intellij.openapi.options.UnnamedConfigurable)3 Settings (com.intellij.openapi.options.ex.Settings)3 ActionCallback (com.intellij.openapi.util.ActionCallback)3 Nullable (org.jetbrains.annotations.Nullable)3 ExtensionsArea (com.intellij.openapi.extensions.ExtensionsArea)2 MasterDetailsComponent (com.intellij.openapi.ui.MasterDetailsComponent)2