void (@Nullable SearchScope selectedScope) { final Scopes.Type scopeType = Scopes.getType(selectedScope); myUpdating = true; try { if (selectedScope instanceof ModuleWithDependenciesScope scope) { myModulesComboBox.setItem(scope.getModule()); } else if (selectedScope instanceof GlobalSearchScopesCore.DirectoryScope directoryScope) { myDirectoryComboBox.setDirectory(directoryScope.getDirectory()); myDirectoryComboBox.setRecursive(directoryScope.isWithSubdirectories()); } else if (selectedScope != null && scopeType == Scopes.Type.NAMED) { selectNamedScope(selectedScope.getDisplayName()); } } finally { myUpdating = false; } showScope(scopeType); }