branch develop updated (591eeeb -> f8a4e74)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository jaxx. See http://git.nuiton.org/jaxx.git from 591eeeb fixes #3607: NumberEditor does not deal well with signed number new d491aac fixes #3607: improve also start limit cases new f8a4e74 fixes #3609: NumberEditor does not accept Long or long number type The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit f8a4e74a827078a7d8f1959ef95fc348d17b7df8 Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Jan 1 17:44:25 2015 +0100 fixes #3609: NumberEditor does not accept Long or long number type commit d491aac4542ba76d50bb6e098860f2943055e3c7 Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Jan 1 17:43:52 2015 +0100 fixes #3607: improve also start limit cases Summary of changes: .../jaxx/widgets/number/NumberEditorHandler.java | 46 +++++++++++++++++++--- 1 file changed, 41 insertions(+), 5 deletions(-) -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository jaxx. See http://git.nuiton.org/jaxx.git commit d491aac4542ba76d50bb6e098860f2943055e3c7 Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Jan 1 17:43:52 2015 +0100 fixes #3607: improve also start limit cases --- .../jaxx/widgets/number/NumberEditorHandler.java | 26 +++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/jaxx-widgets-number/src/main/java/org/nuiton/jaxx/widgets/number/NumberEditorHandler.java b/jaxx-widgets-number/src/main/java/org/nuiton/jaxx/widgets/number/NumberEditorHandler.java index 5efc900..d9e8618 100644 --- a/jaxx-widgets-number/src/main/java/org/nuiton/jaxx/widgets/number/NumberEditorHandler.java +++ b/jaxx-widgets-number/src/main/java/org/nuiton/jaxx/widgets/number/NumberEditorHandler.java @@ -560,7 +560,13 @@ public class NumberEditorHandler implements UIHandler<NumberEditor> { @Override public Byte parse(String textValue) { - return Byte.parseByte(textValue); + Byte v; + if (NULL_LIMIT_INTS.contains(textValue)) { + v = null; + } else { + v = Byte.parseByte(textValue); + } + return v; } }; numberFactories.put(byte.class, byteSupport); @@ -574,7 +580,13 @@ public class NumberEditorHandler implements UIHandler<NumberEditor> { @Override public Short parse(String textValue) { - return Short.parseShort(textValue); + Short v; + if (NULL_LIMIT_INTS.contains(textValue)) { + v = null; + } else { + v = Short.parseShort(textValue); + } + return v; } }; numberFactories.put(short.class, shortSupport); @@ -589,7 +601,7 @@ public class NumberEditorHandler implements UIHandler<NumberEditor> { @Override public Integer parse(String textValue) { Integer v; - if ("-".equals(textValue)) { + if (NULL_LIMIT_INTS.contains(textValue)) { v = null; } else { v = Integer.parseInt(textValue); @@ -626,7 +638,7 @@ public class NumberEditorHandler implements UIHandler<NumberEditor> { @Override public Float parse(String textValue) { Float v; - if ("-".equals(textValue) || "-.".equals(textValue)) { + if (NULL_LIMIT_DECIMALS.contains(textValue)) { v = null; } else { boolean addSign = false; @@ -674,7 +686,7 @@ public class NumberEditorHandler implements UIHandler<NumberEditor> { @Override public Double parse(String textValue) { Double v; - if ("-".equals(textValue)) { + if (NULL_LIMIT_DECIMALS.contains(textValue)) { v = null; } else { @@ -738,4 +750,8 @@ public class NumberEditorHandler implements UIHandler<NumberEditor> { } + protected static final ImmutableSet<String> NULL_LIMIT_DECIMALS = ImmutableSet.copyOf(new String[]{"-", ".", "-."}); + + protected static final ImmutableSet<String> NULL_LIMIT_INTS = ImmutableSet.copyOf(new String[]{"-"}); + } -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository jaxx. See http://git.nuiton.org/jaxx.git commit f8a4e74a827078a7d8f1959ef95fc348d17b7df8 Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Jan 1 17:44:25 2015 +0100 fixes #3609: NumberEditor does not accept Long or long number type --- .../jaxx/widgets/number/NumberEditorHandler.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/jaxx-widgets-number/src/main/java/org/nuiton/jaxx/widgets/number/NumberEditorHandler.java b/jaxx-widgets-number/src/main/java/org/nuiton/jaxx/widgets/number/NumberEditorHandler.java index d9e8618..f6f1a29 100644 --- a/jaxx-widgets-number/src/main/java/org/nuiton/jaxx/widgets/number/NumberEditorHandler.java +++ b/jaxx-widgets-number/src/main/java/org/nuiton/jaxx/widgets/number/NumberEditorHandler.java @@ -612,6 +612,26 @@ public class NumberEditorHandler implements UIHandler<NumberEditor> { numberFactories.put(int.class, integerSupport); numberFactories.put(Integer.class, integerSupport); + NumberParserFormatter<Long> longSupport = new NumberParserFormatter<Long>() { + @Override + public String format(Long numberValue) { + return numberValue == null ? "" : String.valueOf(numberValue); + } + + @Override + public Long parse(String textValue) { + Long v; + if (NULL_LIMIT_INTS.contains(textValue)) { + v = null; + } else { + v = Long.parseLong(textValue); + } + return v; + } + }; + numberFactories.put(long.class, longSupport); + numberFactories.put(Long.class, longSupport); + NumberParserFormatter<Float> floatSupport = new NumberParserFormatter<Float>() { final DecimalFormat df = new DecimalFormat("#.######################"); -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
participants (1)
-
nuiton.org scm