void (@NotNull final Map<String, Set<String>> providerToDisabledTemplates) { TreeState treeState = TreeState.createOn(this, myRoot); visitTemplateNodes(template -> { Set<String> disabledTemplates = providerToDisabledTemplates.get(template.getTemplateProvider().getId()); String key = template.getTemplate().getId(); if (disabledTemplates != null && disabledTemplates.contains(key)) { template.setChecked(false); return; } template.setChecked(true); }); myModel.nodeStructureChanged(myRoot); treeState.applyTo(this); TreeUtil.expandAll(this); }