@Override
    public void render(final Context context, final Number value, final SafeHtmlBuilder sb) {
        // If the value isn't editable then just output the value.
        if (value != null) {
            if (!(value instanceof Editable) || !((Editable) value).isEditable()) {
                sb.append(SafeHtmlUtils.fromString(String.valueOf(value)));

            } else {
                // Get the view data.
                final Object key = context.getKey();

                // Get the current view data if there is some.
                ViewData viewData = getViewData(key);

                // If the value held by the view data object is the same as the
                // passed value then we no longer need the view data object to
                // hold temporary state.
                if (viewData != null && viewData.getCurrentValue() != null) {
                    try {
                        final Number currentValue = Long.valueOf(viewData.getCurrentValue());
                        if (currentValue != null && currentValue.equals(value)) {
                            clearViewData(key);
                            viewData = null;
                        }
                    } catch (final NumberFormatException e) {
                        // Ignore.
                    }
                }

                if (viewData != null) {
                    sb.append(template.input(viewData.getCurrentValue(), arrowUpHtml, arrowDownHtml));
                } else {
                    sb.append(template.input(String.valueOf(value), arrowUpHtml, arrowDownHtml));
                }
            }
        } else {
            sb.append(SafeHtmlUtils.fromSafeConstant("<br/>"));
        }
    }
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