void () { FileTemplate selectedValue = getSelectedTemplate(); FileTemplate prevTemplate = editor == null ? null : editor.getTemplate(); if (prevTemplate != selectedValue) { LOG.assertTrue(editor != null, "selected:" + selectedValue + "; prev:" + prevTemplate); // selection has changed if (prevTemplate != null && currentTab.getTemplates().contains(prevTemplate) && !applyEditor(prevTemplate)) { return; } if (selectedValue == null) { editor.setTemplate(null, FileTemplateManagerImpl.getInstanceImpl(myProject).getDefaultTemplateDescription()); myEditorComponent.repaint(); } else { selectTemplate(selectedValue); } } }