To Wrap it up: I ended up having a PropertiesBuilder interface:
public interface PropertiesBuilder<T> extends Builder {
PropertiesBuilder<T> set(String key, T value);
}
and a Js version:
public final class JsPropertyBuilder implements PropertiesBuilder<Object>,
IsJavaScriptObject {
private final JavaScriptObject jsObject;
public JsPropertyBuilder() {
this.jsObject = JavaScriptObject.createObject();
}
public JavaScriptObject asJavaScriptObject() {
return getJsObject();
}
public JsPropertyBuilder set(String key, Object value) {
UtilsJsni.addProperty(getJsObject(), key, value);
return this;
}
private JavaScriptObject getJsObject() {
return jsObject;
}
}
And the interface :
public interface IsJavaScriptObject {
JavaScriptObject asJavaScriptObject();
}
The component facade contains a method that accepts the IsJavaScriptObject
as input, which makes it mockable (through the GWTBridge) and such that can
I use it in my unit tests.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.