void () { String[] suggestedNames = getSuggestedNames(); myOldName = UsageViewUtil.getShortName(myPsiElement); myNameSuggestionsField = new NameSuggestionsField(suggestedNames, myProject, FileTypes.PLAIN_TEXT, myEditor) { @Override protected boolean shouldSelectAll() { return myEditor == null || myEditor.getSettings().isPreselectRename(); } }; if (myPsiElement instanceof PsiFile && myEditor == null) { myNameSuggestionsField.selectNameWithoutExtension(); } myNameChangedListener = () -> processNewNameChanged(); myNameSuggestionsField.addDataChangedListener(myNameChangedListener); }