JavaEditablePostfixTemplate (@NotNull String templateId, @NotNull String templateName) { LanguageLevel selectedLanguageLevel = ObjectUtils.tryCast(myLanguageLevelCombo.getSelectedItem(), LanguageLevel.class); LanguageLevel languageLevel = ObjectUtils.notNull(selectedLanguageLevel, LanguageLevel.JDK_1_3); Set<JavaPostfixTemplateExpressionCondition> conditions = new LinkedHashSet<>(); ContainerUtil.addAll(conditions, myExpressionTypesListModel.elements()); String templateText = myTemplateEditor.getDocument().getText(); boolean useTopmostExpression = myApplyToTheTopmostJBCheckBox.isSelected(); boolean useStaticImport = myStaticImportCheckBox.isSelected(); JavaEditablePostfixTemplate template = new JavaEditablePostfixTemplate(templateId, templateName, templateText, "", conditions, languageLevel, useTopmostExpression, myProvider); template.getLiveTemplate().setValue(Template.Property.USE_STATIC_IMPORT_IF_POSSIBLE, useStaticImport); return template; }