private void finishEditing(final Element parent, final Number value, final Object key,
                               final ValueUpdater<Number> valueUpdater) {
        // Get the input element.
        final InputElement input = getInputElement(parent);
        if (input != null) {
            final String newValue = input.getValue();

            // Get the object that we are going to use to apply value
            // constraints.
            HasSpinnerConstraints constraints = this;
            if (value instanceof HasSpinnerConstraints) {
                constraints = (HasSpinnerConstraints) value;
            }

            final String constrainedValue = constrainValue(constraints, newValue);
            // Set the value back if it has been constrained by the
            // constrainValue() method.
            if (!newValue.equals(constrainedValue)) {
                input.setValue(constrainedValue);
            }

            // Get the view data.
            ViewData vd = getViewData(key);
            if (vd == null) {
                vd = new ViewData(String.valueOf(value));
                setViewData(key, vd);
            }
            vd.setCurrentValue(constrainedValue);

            // Fire the value updater if the value has changed.
            if (valueUpdater != null && !vd.getCurrentValue().equals(vd.getLastValue())) {
                vd.setLastValue(vd.getCurrentValue());
                valueUpdater.update(Long.valueOf(constrainedValue));
            }
        }

        // Blur the element.
        focusedKey = null;
        getInputElement(parent).blur();
    }
The currently focused value key. Only one key can be focused at any time.
stroom-core-client-widget/src/main/java/stroom/cell/valuespinner/client/ValueSpinnerCell.java