@NotNull private static EditorTextField createTextField(@NotNull Project project) { final EditorTextFieldProvider service = ServiceManager.getService(project, EditorTextFieldProvider.class); List<EditorCustomization> features = ContainerUtil.packNullables(SoftWrapsEditorCustomization.ENABLED, SpellCheckingEditorCustomizationProvider.getInstance().getDisabledCustomization()); EditorTextField textField = service.getEditorField(FileTypes.PLAIN_TEXT.getLanguage(), project, features); textField.setBorder(new CompoundBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2), textField.getBorder())); textField.setOneLineMode(false); return textField; }
public static EditorTextField create(Project project, DataProvider dataProvider) { List<EditorCustomization> customizations = Arrays.<EditorCustomization>asList(SoftWrapsEditorCustomization.ENABLED, SpellCheckingEditorCustomization.DISABLED); EditorTextField editorField = ServiceManager.getService(project, EditorTextFieldProvider.class) .getEditorField(FileTypes.PLAIN_TEXT.getLanguage(), project, customizations); new CommaSeparatedTextFieldCompletion(dataProvider).apply(editorField); return editorField; }