void () { final String text = myTemplate == null ? "" : myTemplate.getText(); String name = myTemplate == null ? "" : myTemplate.getName(); String extension = myTemplate == null ? "" : myTemplate.getExtension(); @NonNls String description = myTemplate == null ? "" : myTemplate.getDescription(); if (description.isEmpty() && defaultDescriptionUrl != null) { description = defaultDescriptionUrl.get(); } EditorFactory.getInstance().releaseEditor(myTemplateEditor); myTemplateEditor = createEditor(myTemplate == null ? null : createFile(text, name)); myNameField.setText(name); myFileName.setText(myTemplate == null ? "" : myTemplate.getFileName()); myExtensionField.setText(extension); myAdjustBox.setSelected(myTemplate != null && myTemplate.isReformatCode()); myLiveTemplateBox.setSelected(myTemplate != null && myTemplate.isLiveTemplateEnabled()); int i = description.indexOf("<html>"); if (i > 0) { description = description.substring(i); } description = XmlStringUtil.stripHtml(description); description = description.replace("\n", "").replace("\r", ""); description = XmlStringUtil.stripHtml(description); description = IdeBundle.message("http.velocity", description); myDescriptionComponent.setText(description); myDescriptionComponent.setCaretPosition(0); boolean editable = isEditable(); myNameField.setEditable(editable); myExtensionField.setEditable(editable); myFileName.setViewer(!editable); myModified = false; }