ScopeDescriptor (List<? extends ScopeDescriptor> scopeDescriptors) { String selectedScope = myProject == null ? null : getSelectedScopes(myProject).get(getClass().getSimpleName()); if (StringUtil.isNotEmpty(selectedScope)) { for (ScopeDescriptor descriptor : scopeDescriptors) { if (!selectedScope.equals(descriptor.getDisplayName()) || descriptor.scopeEquals(null)) continue; return descriptor; } } return new ScopeDescriptor(myProjectScope); }