EditorTextField (boolean replace) { final StructuralSearchProfile profile = StructuralSearchUtil.getProfileByFileType(myFileType); assert profile != null; final Document document = UIUtil.createDocument(myProject, myFileType, myDialect, myPatternContext, "", profile); document.addDocumentListener(this, myDisposable); document.putUserData(STRUCTURAL_SEARCH_PATTERN_CONTEXT_ID, (myPatternContext == null) ? "" : myPatternContext.getId()); final EditorTextField textField = new MyEditorTextField(document, replace); textField.setFont(EditorFontType.getGlobalPlainFont().deriveFont( UISettingsUtils.getInstance().getScaledEditorFontSize() )); textField.setPreferredSize(new Dimension(550, 150)); textField.setMinimumSize(new Dimension(200, 50)); myComponentsWithEditorBackground.add(textField); return textField; }