String (@Nullable Project project, Component parentComponent, String message, String title, @Nullable Icon icon, @Nullable String initialValue, @Nullable InputValidator validator, @Nullable TextRange selection, @Nullable @NlsContexts.DetailedDescription String comment) { if (isApplicationInUnitTestOrHeadless()) { return TestDialogManager.getTestInputImplementation().show(message, validator); } InputDialog dialog = new InputDialog(project, message, title, icon, initialValue, validator, new String[]{getOkButton(), getCancelButton()}, 0, comment); final JTextComponent field = dialog.getTextField(); if (selection != null) { // set custom selection field.select(selection.getStartOffset(), selection.getEndOffset()); field.putClientProperty(DialogWrapperPeer.HAVE_INITIAL_SELECTION, true); } dialog.show(); return dialog.getInputString(); }