use of com.intellij.openapi.options.Configurable in project intellij-community by JetBrains.
the class ShowSettingsUtilImpl method getConfigurables.
/**
* @param project a project used to load project settings or {@code null}
* @param withIdeSettings specifies whether to load application settings or not
* @return all configurables as a plain list except the root configurable group
*/
@NotNull
public static Configurable[] getConfigurables(@Nullable Project project, boolean withIdeSettings) {
ConfigurableGroup group = ConfigurableExtensionPointUtil.getConfigurableGroup(project, withIdeSettings);
List<Configurable> list = new ArrayList<>();
collect(list, group.getConfigurables());
return list.toArray(new Configurable[0]);
}
use of com.intellij.openapi.options.Configurable 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();
}
use of com.intellij.openapi.options.Configurable 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;
}
use of com.intellij.openapi.options.Configurable in project intellij-community by JetBrains.
the class DebuggerConfigurable method compute.
private void compute() {
if (myChildren != null) {
return;
}
List<Configurable> configurables = new SmartList<>();
configurables.add(new DataViewsConfigurable());
DebuggerConfigurableProvider[] providers = DebuggerConfigurableProvider.EXTENSION_POINT.getExtensions();
computeMergedConfigurables(providers, configurables);
for (DebuggerConfigurableProvider provider : providers) {
configurables.addAll(provider.getConfigurables(DebuggerSettingsCategory.ROOT));
}
MergedCompositeConfigurable mergedGeneralConfigurable = computeGeneralConfigurables(providers);
if (configurables.isEmpty() && mergedGeneralConfigurable == null) {
myRootConfigurable = null;
myChildren = EMPTY_CONFIGURABLES;
} else if (configurables.size() == 1) {
Configurable firstConfigurable = configurables.get(0);
if (mergedGeneralConfigurable == null) {
myRootConfigurable = firstConfigurable;
myChildren = EMPTY_CONFIGURABLES;
} else {
Configurable[] generalConfigurables = mergedGeneralConfigurable.children;
Configurable[] mergedArray = new Configurable[generalConfigurables.length + 1];
System.arraycopy(generalConfigurables, 0, mergedArray, 0, generalConfigurables.length);
mergedArray[generalConfigurables.length] = firstConfigurable;
myRootConfigurable = new MergedCompositeConfigurable("", "", mergedArray);
myChildren = firstConfigurable instanceof SearchableConfigurable.Parent ? ((Parent) firstConfigurable).getConfigurables() : EMPTY_CONFIGURABLES;
}
} else {
myChildren = configurables.toArray(new Configurable[configurables.size()]);
myRootConfigurable = mergedGeneralConfigurable;
}
}
use of com.intellij.openapi.options.Configurable in project intellij-community by JetBrains.
the class ConfigurableOptionsTopHitProvider method getOptions.
@NotNull
@Override
public Collection<OptionDescription> getOptions(@Nullable Project project) {
try {
Configurable configurable = getConfigurable(project);
Component component = configurable.createComponent();
configurable.reset();
myPrefix.clear();
String name = getName(configurable);
if (name != null) {
myPrefix.push(name);
}
Collection<BooleanOptionDescription> options = new ArrayList<>();
init(options, configurable, component);
return Collections.unmodifiableCollection(options);
} catch (Exception exception) {
LOG.debug(exception);
}
return Collections.emptyList();
}
Aggregations