Don't allow negative values in the general option pane.
This UI consistent with the other numeric input field on that page, so it is accepted. You can commit directly.
The try/catch should be unnecessary though, since the numeric input field restricts input.
but I wonder why people aren't using an editable spinbox instead for numeric inputs - then you can set a min and a max value for it and you don't have to check for invalid input at all.
New version of the patch attached. This one uses JSpinner component for the number values. Please check the min and max values. are 0 and Integer.MAX sane values for both elements?
This patch depends on java7. Which might be ok, I just want to confirm that we are officially requiring java7 in jEdit 5.1.
v3 - removed accidential Java 7 dependency
please update your patch to work against java 1.6.
Ignore previous comment. Testing your patch now, I see that when the user hits enter, it is not actually consumed by this spinbox and instead registers as an "ok" in the option dialog. There was a similar issue with all comboboxes which was fixed. I will investigate how to fix it for these spinboxes too.
It seems handling of enter key is consistent with other numeric input fields from other panes, so this is accepted.
Log in to post a comment.