IDEA-167520 No "for current project" indicator, when registering a "projectConfigurable"

This commit is contained in:
Sergey Malenkov
2017-03-17 22:14:38 +03:00
parent e18a3f76dc
commit 0cb5de4a5b
2 changed files with 8 additions and 3 deletions
@@ -354,13 +354,13 @@ public class ConfigurableExtensionPointUtil {
Application application = ApplicationManager.getApplication();
if (application != null) {
for (ConfigurableEP<Configurable> extension : application.getExtensions(Configurable.APPLICATION_CONFIGURABLE)) {
addValid(list, ConfigurableWrapper.wrapConfigurable(extension), null);
addValid(list, ConfigurableWrapper.wrapConfigurable(extension, true), null);
}
}
}
if (project != null && !project.isDisposed()) {
for (ConfigurableEP<Configurable> extension : project.getExtensions(Configurable.PROJECT_CONFIGURABLE)) {
addValid(list, ConfigurableWrapper.wrapConfigurable(extension), project);
addValid(list, ConfigurableWrapper.wrapConfigurable(extension, true), project);
}
}
return list;
@@ -38,10 +38,15 @@ public class ConfigurableWrapper implements SearchableConfigurable, Weighted {
@Nullable
public static <T extends UnnamedConfigurable> T wrapConfigurable(@NotNull ConfigurableEP<T> ep) {
return wrapConfigurable(ep, false);
}
@Nullable
public static <T extends UnnamedConfigurable> T wrapConfigurable(@NotNull ConfigurableEP<T> ep, boolean settings) {
if (!ep.canCreateConfigurable()) {
return null;
}
if (ep.displayName != null || ep.key != null || ep.parentId != null || ep.groupId != null) {
if (settings || ep.displayName != null || ep.key != null || ep.parentId != null || ep.groupId != null) {
//noinspection unchecked
return (T)(!ep.dynamic && ep.children == null && ep.childrenEPName == null ? new ConfigurableWrapper(ep) : new CompositeWrapper(ep));
}