class SubFormWidget extends Composite implements TakesValue<Object>,
                                                        IsNestedModel,
                                                        NeedsFlush {

    public void setReadOnly(boolean readOnly) {
        formRenderer.switchToMode(readOnly ? RenderMode.READ_ONLY_MODE : RenderMode.EDIT_MODE);
    }

}