use of com.intellij.openapi.options.ex.SortedConfigurableGroup in project intellij-community by JetBrains.
the class SettingsTreeView method findConfigurableProject.
@Nullable
private static Project findConfigurableProject(@NotNull MyNode node, boolean checkProjectLevel) {
Configurable configurable = node.myConfigurable;
Project project = node.getProject();
if (checkProjectLevel) {
Configurable.VariableProjectAppLevel wrapped = ConfigurableWrapper.cast(Configurable.VariableProjectAppLevel.class, configurable);
if (wrapped != null)
return wrapped.isProjectLevel() ? project : null;
}
if (configurable instanceof ConfigurableWrapper)
return project;
if (configurable instanceof SortedConfigurableGroup)
return project;
SimpleNode parent = node.getParent();
return parent instanceof MyNode ? findConfigurableProject((MyNode) parent, checkProjectLevel) : null;
}
use of com.intellij.openapi.options.ex.SortedConfigurableGroup in project intellij-community by JetBrains.
the class SettingsTreeView method prepareProject.
@Nullable
private static Project prepareProject(CachingSimpleNode parent, Configurable configurable) {
if (configurable instanceof ConfigurableWrapper) {
ConfigurableWrapper wrapper = (ConfigurableWrapper) configurable;
return wrapper.getExtensionPoint().getProject();
}
if (configurable instanceof SortedConfigurableGroup) {
SortedConfigurableGroup group = (SortedConfigurableGroup) configurable;
Configurable[] configurables = group.getConfigurables();
if (configurables != null && configurables.length != 0) {
Project project = prepareProject(parent, configurables[0]);
if (project != null) {
for (int i = 1; i < configurables.length; i++) {
if (project != prepareProject(parent, configurables[i])) {
return null;
}
}
}
return project;
}
}
return parent == null ? null : parent.getProject();
}
Aggregations