boolean (@NotNull String group, @Nullable String name) { ListModel<TemplatesGroup> model = myProjectTypeList.getModel(); for (int i = 0; i < model.getSize(); i++) { TemplatesGroup templatesGroup = model.getElementAt(i); if (group.equals(templatesGroup.getName())) { myProjectTypeList.setSelectedIndex(i); if (name == null) { return getSelectedGroup().getName().equals(group); } else { setTemplatesList(templatesGroup, myTemplatesMap.get(templatesGroup), false); return myTemplatesList.setSelectedTemplate(name); } } } return false; }