Search in sources :

Example 6 with ConfigurableGroup

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

the class ShowSettingsUtilImpl method showSettingsDialog.

public static void showSettingsDialog(@Nullable Project project, final String id2Select, final String filter) {
    ConfigurableGroup[] group = getConfigurableGroups(project, true);
    group = filterEmptyGroups(group);
    final Configurable configurable2Select = id2Select == null ? null : new ConfigurableVisitor.ByID(id2Select).find(group);
    SettingsDialogFactory.getInstance().create(getProject(project), group, configurable2Select, filter).show();
}
Also used : ConfigurableGroup(com.intellij.openapi.options.ConfigurableGroup) Configurable(com.intellij.openapi.options.Configurable) TabbedConfigurable(com.intellij.openapi.options.TabbedConfigurable)

Example 7 with ConfigurableGroup

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

the class IdeSettingsDialogFixture method getProjectSettingsNames.

@NotNull
public List<String> getProjectSettingsNames() {
    List<String> names = new ArrayList<>();
    JPanel optionsEditor = field("myEditor").ofType(JPanel.class).in(getDialogWrapper()).get();
    assertNotNull(optionsEditor);
    List<JComponent> trees = findComponentsOfType(optionsEditor, "com.intellij.openapi.options.newEditor.SettingsTreeView");
    assertThat(trees).hasSize(1);
    JComponent tree = trees.get(0);
    CachingSimpleNode root = field("myRoot").ofType(CachingSimpleNode.class).in(tree).get();
    assertNotNull(root);
    ConfigurableGroup[] groups = field("myGroups").ofType(ConfigurableGroup[].class).in(root).get();
    assertNotNull(groups);
    for (ConfigurableGroup current : groups) {
        Configurable[] configurables = current.getConfigurables();
        for (Configurable configurable : configurables) {
            names.add(configurable.getDisplayName());
        }
    }
    return names;
}
Also used : ConfigurableGroup(com.intellij.openapi.options.ConfigurableGroup) ArrayList(java.util.ArrayList) Configurable(com.intellij.openapi.options.Configurable) CachingSimpleNode(com.intellij.ui.treeStructure.CachingSimpleNode) Assert.assertNotNull(org.junit.Assert.assertNotNull) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

Configurable (com.intellij.openapi.options.Configurable)7 ConfigurableGroup (com.intellij.openapi.options.ConfigurableGroup)7 NotNull (org.jetbrains.annotations.NotNull)4 TabbedConfigurable (com.intellij.openapi.options.TabbedConfigurable)3 CachingSimpleNode (com.intellij.ui.treeStructure.CachingSimpleNode)2 ArrayList (java.util.ArrayList)2 AllFileTemplatesConfigurable (com.intellij.ide.fileTemplates.impl.AllFileTemplatesConfigurable)1 PluginManagerConfigurable (com.intellij.ide.plugins.PluginManagerConfigurable)1 ConfigurableHit (com.intellij.ide.ui.search.ConfigurableHit)1 SearchableConfigurable (com.intellij.openapi.options.SearchableConfigurable)1 ConfigurableVisitor (com.intellij.openapi.options.ex.ConfigurableVisitor)1 THashSet (gnu.trove.THashSet)1 Assert.assertNotNull (org.junit.Assert.assertNotNull)1