public void setReadOnly(boolean readOnly) {
        getElement().setPropertyBoolean("readOnly", readOnly);
        String readOnlyStyle = "readonly";
        if (readOnly) {
            addStyleDependentName(readOnlyStyle);
        } else {
            removeStyleDependentName(readOnlyStyle);
        }
    }
Turns read-only mode on or off.

@param readOnly if <code>true</code>, the widget becomes read-only; if
                <code>false</code> the widget becomes editable
stroom-core-client-widget/src/main/java/com/google/gwt/user/client/ui/ValueBoxBase.java