private void syncState(final Widget widget, final String property, final InitialState initialState) {
if (initialState != null) {
Object value = null;
if (widget instanceof HasValue) {
HasValue hasValue = (HasValue) widget;
value = initialState.getInitialValue(proxy.get(property), hasValue.getValue());
if (initialState == InitialState.FROM_MODEL) {
Object widgetValue =
Convert.toWidgetValue(widget, propertyTypes.get(property).getType(), value, converters.get(property));
hasValue.setValue(widgetValue);
}
}
else if (widget instanceof HasText) {
HasText hasText = (HasText) widget;
value = initialState.getInitialValue(proxy.get(property), hasText.getText());