public Integer getIntValue() { if (!validate()) return null; Integer rslt = null; try { rslt = Integer.parseInt(getValue()); } catch (Exception e) { // nothing, can continue } return rslt; }
@Override public void setValue(String value, boolean fireEvents) { super.setValue(value, fireEvents); validate(); }
public Double getDoubleValue() { if (!validate()) return null; Double rslt = null; String s = getValue(); try { rslt = Double.parseDouble(s); } catch (Exception e) { if (s != null) { if (s.indexOf('.') >= 0) s = s.replaceAll("\\.", ","); else if (s.indexOf(',') >= 0) s = s.replaceAll("\\,", "."); } try { rslt = Double.parseDouble(s); } catch (Exception e1) { // nothing, can continue } } return rslt; } }
private void checkBlurHandler() { if (blurReg != null || !isAttached()) return; if (validateAsInt || validateAsDouble) { blurReg = addBlurHandler(blur -> validate()); } }