void (AnActionButton button) { final String rawAddedLocales = Messages.showInputDialog(myProject, PropertiesBundle.message("create.resource.bundle.dialog.add.locales.validator.message"), PropertiesBundle.message("create.resource.bundle.dialog.add.locales.validator.title"), null, null, new InputValidatorEx() { @Nullable @Override public String getErrorText(String inputString) { return checkInput(inputString) ? null : PropertiesBundle.message("create.resource.bundle.invalid.locales.error.text"); } @Override public boolean checkInput(String inputString) { return extractLocalesFromString(inputString) != null; } @Override public boolean canClose(String inputString) { return checkInput(inputString); } }); if (rawAddedLocales != null) { final Map<Locale, String> locales = extractLocalesFromString(rawAddedLocales); LOG.assertTrue(locales != null); myLocaleSuffixes.putAll(locales); myLocalesModel.add(new ArrayList<>(locales.keySet())); } }