private void initTemplates(List<? extends TemplateGroup> groups, String lastSelectedGroup, String lastSelectedKey) {
    myTreeRoot.removeAllChildren();
    myTemplateGroups.clear();
    mutatorHelper.clear();
    for (TemplateGroup group : groups) {
      myTemplateGroups.add(mutatorHelper.copy(group));
    }

    for (TemplateGroup group : myTemplateGroups) {
      CheckedTreeNode groupNode = new CheckedTreeNode(group);
      addTemplateNodes(group, groupNode);
      myTreeRoot.add(groupNode);
    }
    fireStructureChange();

    selectTemplate(lastSelectedGroup, lastSelectedKey);
  }
private void initTemplates(List<? extends TemplateGroup> groups, String lastSelectedGroup, String lastSelectedKey)