private @Nullable <T> T editNumber(String key, String value, Function<? super String, ? extends T> parser) {
        String newValue = Messages.showInputDialog(getRootPane(), IdeBundle.message("dialog.message.enter.new.value.for.0", key),
                                                   IdeBundle.message("dialog.title.number.editor"), null, value,
                                                   new InputValidator() {
                                                     @Override
                                                     public boolean checkInput(String inputString) {
                                                       try {
                                                         parser.apply(inputString);
                                                         return true;
                                                       }
                                                       catch (NumberFormatException nfe) {
                                                         return false;
                                                       }
                                                     }

                                                     @Override
                                                     public boolean canClose(String inputString) {
                                                       return checkInput(inputString);
                                                     }
                                                   });

        return newValue != null ? parser.apply(newValue) : null;
      }
private @Nullable <T> T editNumber(String key, String value, Function<? super String, ? extends T> parser)