JComponent (String[] nameSuggestions, FileType fileType) { final String text; if (nameSuggestions != null && nameSuggestions.length > 0 && nameSuggestions[0] != null) { text = nameSuggestions[0]; } else { text = ""; } EditorTextField field = new EditorTextField(text, myProject, fileType); field.selectAll(); return field; }