(StringProperty stringProperty)
| 91 | } |
| 92 | |
| 93 | private void addNumericValidator(StringProperty stringProperty) { |
| 94 | stringProperty.addListener((ObservableValue<? extends String> prop, String oldVal, String newVal) -> { |
| 95 | if (newVal == null || newVal.isEmpty()) { |
| 96 | return; |
| 97 | } |
| 98 | if (!newVal.matches("(\\+|-)?(x|$)?[0-9a-fA-F]*")) { |
| 99 | stringProperty.set(""); |
| 100 | } |
| 101 | }); |
| 102 | } |
| 103 | |
| 104 | public int parseInt(String s) throws NumberFormatException { |
| 105 | if (s == null || s.isEmpty()) { |
no test coverage detected